HttpServletResponse response,
ActionErrors errors,
Exception exception) {
// Cast as our subclass base type
ChainedException e = (ChainedException) exception;
// Log and print to error console
servlet.log("Action Exception: ", e );
e.printStackTrace();
// General error message
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.general"));
// Generate error messages from exceptions
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.detail",e.getMessage()));
if (e.isCause()) {
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.detail",e.getCauseMessage()));
}
}