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: * <p>In this version of JCL, this exception will never be thrown in practice. However, it is
25: * included here to ensure total compile time and run time compatibility with the original JCL 1.0.4.
26: *
27: * @author Craig R. McClanahan
28: */
29:
30: public class LogConfigurationException extends RuntimeException {
31:
32: /**
33: * Construct a new exception with <code>null</code> as its detail message.
34: */
35: public LogConfigurationException() {
36:
37: super ();
38:
39: }
40:
41: /**
42: * Construct a new exception with the specified detail message.
43: *
44: * @param message The detail message
45: */
46: public LogConfigurationException(String message) {
47:
48: super (message);
49:
50: }
51:
52: /**
53: * Construct a new exception with the specified cause and a derived
54: * detail message.
55: *
56: * @param cause The underlying cause
57: */
58: public LogConfigurationException(Throwable cause) {
59:
60: this ((cause == null) ? null : cause.toString(), cause);
61:
62: }
63:
64: /**
65: * Construct a new exception with the specified detail message and cause.
66: *
67: * @param message The detail message
68: * @param cause The underlying cause
69: */
70: public LogConfigurationException(String message, Throwable cause) {
71:
72: super (message + " (Caused by " + cause + ")");
73: this .cause = cause; // Two-argument version requires JDK 1.4 or later
74:
75: }
76:
77: /**
78: * The underlying cause of this exception.
79: */
80: protected Throwable cause = null;
81:
82: /**
83: * Return the underlying cause of this exception (if any).
84: */
85: public Throwable getCause() {
86:
87: return (this.cause);
88:
89: }
90:
91: }
|