oracle.panama
Interface NestedException
- All Known Implementing Classes:
- PanamaException, PanamaRuntimeException, LBSException
- public interface NestedException
The Panama System Nested Exception Interface. A nested Exception is a chain of Exceptions ending up in a null
detailed Exception.
Example of a function to write the complete stack trace of a NestedException:
... // Fragments
String printNestedStackTrace(Throwable ex) {
StringWriter traceWriter = new StringWriter();
ex.printStackTrace(traceWriter);
// Get out all details in a complete stack trace
Throwable detail = ex;
while (detail instanceof NestedException) {
detail = ((NestedException)detail).getDetail();
traceWriter.write("\nNested Exception is:\n");
detail.printStackTrace(traceWriter);
}
return traceWriter.toString();
}
...
Type | Method |
java.lang.Throwable |
getDetail()
Get the nested exception. |
getDetail
public java.lang.Throwable getDetail()
- Get the nested exception.
- Returns:
- The nested exception or null if none.