Name
UndeclaredThrowableException
Synopsis
Thrown by a method of a
Proxy
object if the invoke( )
method of the proxy’s
InvocationHandler
throws a checked exception not
declared by the original method. This class serves as an unchecked
exception wrapper around the checked exception. Use
getUndeclaredThrowable( )
to obtain the checked
exception thrown by invoke( )
. In Java 1.4 and
later, all exceptions can be
“chained” in this way, and
getUndeclaredThrowable( )
is superseded by the
more general getCause( )
method.
Figure 10-103. java.lang.reflect.UndeclaredThrowableException
public class UndeclaredThrowableException extends RuntimeException { // Public Constructors public UndeclaredThrowableException(Throwable undeclaredThrowable); public UndeclaredThrowableException(Throwable undeclaredThrowable, String s); // Public Instance Methods public Throwable getUndeclaredThrowable( ); // Public Methods Overriding Throwable 1.4 public Throwable getCause( ); }
Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.