1. /* $Id: PluginException.java,v 1.5 2004/05/10 06:36:38 skitching Exp $
  2. *
  3. * Copyright 2004 The Apache Software Foundation.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. package org.apache.commons.digester.plugins;
  18. /**
  19. * Thrown when some plugin-related error has occurred, and none of the
  20. * other exception types are appropriate.
  21. *
  22. * @since 1.6
  23. */
  24. public class PluginException extends Exception {
  25. private Throwable cause = null;
  26. /**
  27. * @param cause underlying exception that caused this to be thrown
  28. */
  29. public PluginException(Throwable cause) {
  30. this(cause.getMessage());
  31. this.cause = cause;
  32. }
  33. /**
  34. * @param msg describes the reason this exception is being thrown.
  35. */
  36. public PluginException(String msg) {
  37. super(msg);
  38. }
  39. /**
  40. * @param msg describes the reason this exception is being thrown.
  41. * @param cause underlying exception that caused this to be thrown
  42. */
  43. public PluginException(String msg, Throwable cause) {
  44. this(msg);
  45. this.cause = cause;
  46. }
  47. /**
  48. * @return the underlying exception that caused this to be thrown
  49. */
  50. public Throwable getCause() {
  51. return cause;
  52. }
  53. }