Throwable cause = (Throwable) request.getAttribute(ERROR_EXCEPTION);
String errorName = null;
// Handle customization of error from exception details
if (cause instanceof ErrorStatusException) {
ErrorStatusException e = (ErrorStatusException) cause;
errorCode = e.getResponseCode();
errorName = e.getReasonPhrase();
errorMessage = messageOf(e);
}
// this happens if someone browses directly to the error page
if (errorCode == null) {