001 /* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017 018 package org.apache.commons.logging; 019 020 021 /** 022 * <p>An exception that is thrown only if a suitable <code>LogFactory</code> 023 * or <code>Log</code> instance cannot be created by the corresponding 024 * factory methods.</p> 025 * 026 * @author Craig R. McClanahan 027 * @version $Revision: 424107 $ $Date: 2006-07-21 01:15:42 +0200 (fr, 21 jul 2006) $ 028 */ 029 030 public class LogConfigurationException extends RuntimeException { 031 032 033 /** 034 * Construct a new exception with <code>null</code> as its detail message. 035 */ 036 public LogConfigurationException() { 037 038 super(); 039 040 } 041 042 043 /** 044 * Construct a new exception with the specified detail message. 045 * 046 * @param message The detail message 047 */ 048 public LogConfigurationException(String message) { 049 050 super(message); 051 052 } 053 054 055 /** 056 * Construct a new exception with the specified cause and a derived 057 * detail message. 058 * 059 * @param cause The underlying cause 060 */ 061 public LogConfigurationException(Throwable cause) { 062 063 this((cause == null) ? null : cause.toString(), cause); 064 065 } 066 067 068 /** 069 * Construct a new exception with the specified detail message and cause. 070 * 071 * @param message The detail message 072 * @param cause The underlying cause 073 */ 074 public LogConfigurationException(String message, Throwable cause) { 075 076 super(message + " (Caused by " + cause + ")"); 077 this.cause = cause; // Two-argument version requires JDK 1.4 or later 078 079 } 080 081 082 /** 083 * The underlying cause of this exception. 084 */ 085 protected Throwable cause = null; 086 087 088 /** 089 * Return the underlying cause of this exception (if any). 090 */ 091 public Throwable getCause() { 092 093 return (this.cause); 094 095 } 096 097 098 }