What are Chained Exceptions?
Example of a chained exception: try
{
}
catch (IOException e)
{
throw new xxxException("Other IOException", e);
}
When an application responds to an exception by throwing another exception, it is very useful to know when an exception caused another. Chained Exceptions help the programmer do this.
The following are the methods and constructors in Throwable that support chained exceptions:1. Throwable getCause()
2. Throwable initCause(Throwable)
3. Throwable(String, Throwable)
4. Throwable(Throwable)