code: public static void sendDevTimeError( String messageKey, Object[] messageArgs, Throwable cause,
                                           int productionTimeErrorCode, ServletRequest request,
                                           ServletResponse response, ServletContext servletContext )
              throws IOException
      {
          boolean prodMode = AdapterManager.getServletContainerAdapter( servletContext ).isInProductionMode();
          boolean avoidDirectResponseOutput = avoidDirectResponseOutput( request );
  
          if ( prodMode && ! avoidDirectResponseOutput && response instanceof HttpServletResponse )
          {
              if ( _log.isErrorEnabled() )
              {
                  _log.error( "Error (message key " + messageKey + ") occurred.  Response error was set to "
                              + productionTimeErrorCode, cause );
              }
  
              ( ( HttpServletResponse ) response ).sendError( productionTimeErrorCode );
          }
          else
          {
              sendError( messageKey, messageArgs, request, response, cause, prodMode || avoidDirectResponseOutput );
          }
      }
docs: If not in production mode, write an error to the response; otherwise, set a response error code.
  @deprecated Use {@link #sendDevTimeError(String, Throwable, int, ServletRequest, ServletResponse, ServletContext, Object[])}