01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.commons.logging;
18:
19: /**
20: * <p>An exception that is thrown only if a suitable <code>LogFactory</code>
21: * or <code>Log</code> instance cannot be created by the corresponding
22: * factory methods.</p>
23: *
24: * @author Craig R. McClanahan
25: * @version $Revision: 155426 $ $Date: 2005-02-26 13:10:49 +0000 (Sat, 26 Feb 2005) $
26: */
27:
28: public class LogConfigurationException extends RuntimeException {
29:
30: /**
31: * Construct a new exception with <code>null</code> as its detail message.
32: */
33: public LogConfigurationException() {
34:
35: super ();
36:
37: }
38:
39: /**
40: * Construct a new exception with the specified detail message.
41: *
42: * @param message The detail message
43: */
44: public LogConfigurationException(String message) {
45:
46: super (message);
47:
48: }
49:
50: /**
51: * Construct a new exception with the specified cause and a derived
52: * detail message.
53: *
54: * @param cause The underlying cause
55: */
56: public LogConfigurationException(Throwable cause) {
57:
58: this ((cause == null) ? null : cause.toString(), cause);
59:
60: }
61:
62: /**
63: * Construct a new exception with the specified detail message and cause.
64: *
65: * @param message The detail message
66: * @param cause The underlying cause
67: */
68: public LogConfigurationException(String message, Throwable cause) {
69:
70: super (message + " (Caused by " + cause + ")");
71: this .cause = cause; // Two-argument version requires JDK 1.4 or later
72:
73: }
74:
75: /**
76: * The underlying cause of this exception.
77: */
78: protected Throwable cause = null;
79:
80: /**
81: * Return the underlying cause of this exception (if any).
82: */
83: public Throwable getCause() {
84:
85: return (this.cause);
86:
87: }
88:
89: }
|