1 /*
2 * $Id: TransformerException.java 2993 2011-11-24 19:51:48Z andrewinkler $
3 * ============================================================================
4 * Project gluehloch-homepage-core
5 * Copyright (c) 2004-2007 by Andre Winkler. All rights reserved.
6 * ============================================================================
7 * GNU LESSER GENERAL PUBLIC LICENSE
8 * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26 package de.awtools.homegen;
27
28 import org.apache.commons.logging.Log;
29 import org.apache.commons.logging.LogFactory;
30
31 /**
32 * Falls mal was schief geht...
33 *
34 * @version $LastChangedRevision: 2993 $ $LastChangedDate: 2011-11-24 20:51:48 +0100 (Thu, 24 Nov 2011) $
35 * @author by Andre Winkler, $LastChangedBy: andrewinkler $
36 *
37 * @since 1.2
38 */
39 public class TransformerException extends RuntimeException {
40
41 /** serial version id */
42 private static final long serialVersionUID = 972950346071910600L;
43
44 /** Der private Logger der Klasse. */
45 private final Log log = LogFactory.getLog(TransformerException.class);
46
47 /**
48 * Konstruktor.
49 *
50 * @param message Eine Nachricht.
51 */
52 public TransformerException(final String message) {
53 this(message, null);
54 }
55
56 /**
57 * Konstruktor.
58 *
59 * @param ex Die ursprüngliche Ausnahme.
60 */
61 public TransformerException(final Exception ex) {
62 this(null, ex);
63 }
64
65 /**
66 * Konstruktor.
67 *
68 * @param message Eine Nachricht.
69 * @param ex Die ursprüngliche Ausnahme.
70 */
71 public TransformerException(final String message, final Exception ex) {
72 super(message, ex);
73
74 // @todo Maven hat einige Probleme mit der Verwaltung von Exceptions,
75 // deswegen:
76 if (ex != null) {
77 ex.printStackTrace(System.out);
78 }
79 log.fatal(message, ex);
80 }
81
82 }