private boolean isInternalError(HttpServletRequest request, HttpServletResponse response) {
    Throwable th = (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
    return null != th && response.getStatus() == HttpStatus.SC_INTERNAL_SERVER_ERROR;
  }
Wraps the given ErrorHandler to log the error stacks
ambari-server/src/main/java/org/apache/ambari/server/api/AmbariViewErrorHandlerProxy.java