code: protected void sendInternalServerError(HttpServletRequest request, HttpServletResponse response, Throwable cause) throws IOException {
          if (cause != null) {
              processServerErrorCallback(request, response, cause);
              request.setAttribute(ERROR_EXCEPTION_ATTRIBUTE_KEY, cause); // for something outer process
          }
          try {
              if (!response.isCommitted()) { // might be committed in callback
                  response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
              }
          } catch (IOException sendEx) {
              final String msg = "Failed to send error as '500 Error': " + sendEx.getMessage();
              if (errorLogging) {
                  logger.error(msg);
              } else {
                  logger.debug(msg);
              }
              return; // cannot help it
          }
      }
docs: =====================