I\'d like to know how I could I thorw a \"final\" Exception, containing a detail message with all the detail messages of a number of chained exceptions.
I had saved all attributes in a class object with the following example:
public List getMessageList(Throwable throwable) {
List errorMessageList = new ArrayList();
while (throwable != null) {
ErrorMessage message = new ErrorMessage();
message.set_message( throwable.getMessage());
message.set_line(throwable.getStackTrace()[0].getLineNumber());
message.set_methodName(throwable.getStackTrace()[0].getMethodName());
message.set_fileName(throwable.getStackTrace()[0].getFileName() );
message.set_className(throwable.getStackTrace()[0].getClassName());
errorMessageList.add(message);
throwable = throwable.getCause();
}
return errorMessageList;
}