Class UndeclaredThrowableException

All Implemented Interfaces:
Serializable

public class UndeclaredThrowableException
extends RuntimeException
This class provides a wrapper for an undeclared, checked exception thrown by an InvocationHandler.
See Also:
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]), Serialized Form
  • Constructor Details

    • UndeclaredThrowableException

      public UndeclaredThrowableException​(Throwable exception)
      Constructs a new UndeclaredThrowableException instance with the undeclared, checked exception that occurred.
      Parameters:
      exception - the undeclared, checked exception that occurred
    • UndeclaredThrowableException

      public UndeclaredThrowableException​(Throwable exception, String detailMessage)
      Constructs a new UndeclaredThrowableException instance with the undeclared, checked exception that occurred and a message.
      Parameters:
      detailMessage - the detail message for the exception
      exception - the undeclared, checked exception that occurred
  • Method Details

    • getUndeclaredThrowable

      public Throwable getUndeclaredThrowable()
      Returns the undeclared, checked exception that occurred, which may be null.
      Returns:
      the undeclared, checked exception that occurred
    • getCause

      public Throwable getCause()
      Returns the undeclared, checked exception that occurred, which may be null.
      Overrides:
      getCause in class Throwable
      Returns:
      the undeclared, checked exception that occurred