1. /*
  2. * Copyright 2001-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  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. package org.apache.commons.logging;
  17. /**
  18. * <p>An exception that is thrown only if a suitable <code>LogFactory</code>
  19. * or <code>Log</code> instance cannot be created by the corresponding
  20. * factory methods.</p>
  21. *
  22. * @author Craig R. McClanahan
  23. * @version $Revision: 1.6 $ $Date: 2004/02/28 21:46:45 $
  24. */
  25. public class LogConfigurationException extends RuntimeException {
  26. /**
  27. * Construct a new exception with <code>null</code> as its detail message.
  28. */
  29. public LogConfigurationException() {
  30. super();
  31. }
  32. /**
  33. * Construct a new exception with the specified detail message.
  34. *
  35. * @param message The detail message
  36. */
  37. public LogConfigurationException(String message) {
  38. super(message);
  39. }
  40. /**
  41. * Construct a new exception with the specified cause and a derived
  42. * detail message.
  43. *
  44. * @param cause The underlying cause
  45. */
  46. public LogConfigurationException(Throwable cause) {
  47. this((cause == null) ? null : cause.toString(), cause);
  48. }
  49. /**
  50. * Construct a new exception with the specified detail message and cause.
  51. *
  52. * @param message The detail message
  53. * @param cause The underlying cause
  54. */
  55. public LogConfigurationException(String message, Throwable cause) {
  56. super(message + " (Caused by " + cause + ")");
  57. this.cause = cause; // Two-argument version requires JDK 1.4 or later
  58. }
  59. /**
  60. * The underlying cause of this exception.
  61. */
  62. protected Throwable cause = null;
  63. /**
  64. * Return the underlying cause of this exception (if any).
  65. */
  66. public Throwable getCause() {
  67. return (this.cause);
  68. }
  69. }