public class ChainedException extends Exception
Exception is the base class for the this Exception module.Exception class and adds Chaining feature.
Through the use of chaining, stack traces of all the exceptions in the chain
can be maintained. printStackTrace() method of
Exception class and prints the stack trace of both the Exceptions
(the original exception and the exception that is replacing the original
exception).| Constructor and Description |
|---|
ChainedException()
Constructor.
|
ChainedException(String message)
Constructor.
|
ChainedException(String message,
Throwable cause)
Useful for revealing the original error with a bonus message.
|
ChainedException(Throwable cause)
Useful for revealing the original error.
|
| Modifier and Type | Method and Description |
|---|---|
Throwable |
getCause()
Gets the cause of the actual exception.
|
void |
printStackTrace()
Overridden method to include the stack trace of the original exception.
|
void |
printStackTrace(PrintStream ps)
Overridden method to include the stack trace of the original exception.
|
void |
printStackTrace(PrintWriter pw)
Overridden method to include the stack trace of the original exception.
|
String |
toString() |
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, setStackTracepublic ChainedException()
public ChainedException(String message)
message - message representing the cause of exceptionpublic ChainedException(String message, Throwable cause)
message - message representing the cause of exceptioncause - Exception that needs to be chainedpublic ChainedException(Throwable cause)
cause - Exception that needs to be chainedpublic Throwable getCause()
getCause in class ThrowableThrowable.getCause()public void printStackTrace()
printStackTrace in class ThrowableThrowable.printStackTrace()public void printStackTrace(PrintStream ps)
printStackTrace in class Throwableps - the psThrowable.printStackTrace(java.io.PrintStream)public void printStackTrace(PrintWriter pw)
printStackTrace in class Throwablepw - the pwThrowable.printStackTrace(java.io.PrintWriter)Copyright © 2016 utils4j. All Rights Reserved.