Tuesday, May 8, 2007

Chained Exception

It is the process in which a exception causes another exception with the original cause attached and the chain of exceptions is thrown up to the next higher level exception handler.

For example


try
{

}
catch (IOException e)
{
throw new SampleException("Other IOException", e);
}




The following are the methods and constructors in Throwable that support chained exceptions.

Throwable getCause()
Throwable initCause(Throwable)
Throwable(String, Throwable)
Throwable(Throwable)

No comments: