public class UnhandledException extends NestableRuntimeException
Thrown when it is impossible or undesirable to consume or throw a checked exception.
This exception supplements the standard exception classes by providing a more semantically rich description of the problem.UnhandledException represents the case where a method has to deal
with a checked exception but does not wish to.
Instead, the checked exception is rethrown in this unchecked wrapper.
public void foo() {
try {
// do something that throws IOException
} catch (IOException ex) {
// don't want to or can't throw IOException from foo()
throw new UnhandledException(ex);
}
}
| Constructor and Description |
|---|
UnhandledException(java.lang.String message,
java.lang.Throwable cause)
Constructs the exception using a message and cause.
|
UnhandledException(java.lang.Throwable cause)
Constructs the exception using a cause.
|
getCause, getMessage, getMessage, getMessages, getThrowable, getThrowableCount, getThrowables, indexOfThrowable, indexOfThrowable, printPartialStackTrace, printStackTrace, printStackTrace, printStackTracepublic UnhandledException(java.lang.Throwable cause)
cause - the underlying causepublic UnhandledException(java.lang.String message,
java.lang.Throwable cause)
message - the message to usecause - the underlying causeCopyright © 2010 - 2023 Adobe. All Rights Reserved