<pre>
Custom static error pages. Limited to 10KB per page.
Only returned in `GET` requests if `view=FULL` is set.
</pre>

<code>repeated .google.appengine.v1.ErrorHandler error_handlers = 101;</code>
491537
public com.google.appengine.v1.ErrorHandler getErrorHandlers(int index) {
    return errorHandlers_.get(index);
  }
1214324
public String getErrorPage(int status, ServletHttpRequest request)
    {
        String error_page= null;
        Class exClass= (Class)request.getAttribute(ServletHandler.__J_S_ERROR_EXCEPTION_TYPE);

        if (ServletException.class.equals(exClass))
        {
            error_page= _webApplicationContext.getErrorPage(exClass.getName());
            if (error_page == null)
            {
                Throwable th= (Throwable)request.getAttribute(ServletHandler.__J_S_ERROR_EXCEPTION);
                while (th instanceof ServletException)
                    th= ((ServletException)th).getRootCause();
                if (th != null)
                    exClass= th.getClass();
            }
        }

        if (error_page == null && exClass != null)
        {
            while (error_page == null && exClass != null && _webApplicationContext != null)
            {
                error_page= _webApplicationContext.getErrorPage(exClass.getName());
                exClass= exClass.getSuperclass();
            }

            if (error_page == null)
            {}
        }

        if (error_page == null && _webApplicationContext != null)
            error_page= _webApplicationContext.getErrorPage(TypeUtil.toString(status));

        return error_page;
    }
1320332
def json_error_handler(exception):
    
    http_exception = isinstance(exception, exceptions.HTTPException)
    code = exception.code if http_exception else 500

    # log exceptions only (app debug should be off)
    if code == 500:
        current_app.logger.error(exception)

    response = jsonify(dict(message=str(exception)))
    response.status_code = code
    return response
722329
final ParseErrorDetails renderError() {
    final int errorIndex = toIndex(currentErrorAt);
    final String encounteredName = getEncountered();
    final ArrayList<String> errorStrings = Lists.arrayList(errors.size());
    for (Object error : errors) {
      errorStrings.add(String.valueOf(error));
    }
    switch (currentErrorType) {
    case UNEXPECTED :
      return new EmptyParseError(errorIndex, encounteredName) {
        @Override public String getUnexpected() {
          return errorStrings.get(0);
        }
      };
    case FAILURE :
      return new EmptyParseError(errorIndex, encounteredName) {
        @Override public String getFailureMessage() {
          return errorStrings.get(0);
        }
      };
    case EXPECTING:
    case MISSING:
    case DELIMITING:
      return new EmptyParseError(errorIndex, encounteredName) {
        @Override public List<String> getExpected() {
          return errorStrings;
        }
      };
    default:
      return new EmptyParseError(errorIndex, encounteredName);
    }
  }
15552
function ErrorRenderer(err, req, res) {
    PageRenderer.call(this, req, res);
    Object.defineProperties(this, {
        err: {
            value: err || new Error()
        }
    });
    req.attrs.isErrorPage = true;
}
180906
public ErrorPage getErrorPageTraverseRootCause(Throwable th) {
        while (th != null && th instanceof ServletException) { // defect 155880
            // - Check
            // rootcause !=
            // null
            Throwable rootCause = ((ServletException) th).getRootCause();
            if (rootCause == null) {
                break;
            }
            ErrorPage er = getErrorPageByExceptionType(th);
            if (er != null)
                return er;

            th = rootCause;
        }
        if (th != null)
            return getErrorPageByExceptionType(th);
        return null;
    }
883160
function Request_handleError(response) {
        var request, code, that = this;

        if (this.isRendered) {
            // we have multiple recursion in parse for catching
            return false;
        }
        // log error request
        logger.error('Request:', {
            url: this.url,
            status: this.statusCode,
            id: this.id,
            isRendered: this.isRendered,
            content_type: this.getHeader('content-type'),
            message: response
        });

        if (response instanceof Error) {
            response = error.silentHttpError(500, {}, 'SlientHttpError: mvcjs error is not thrown', response);
        }
        // get error code from message
        code = getErrorCode(response);
        // set status codes
        this.setStatusCode(code);
        // stop current chain!!!
        this.stopPromiseChain();

        response += '\n';
        response += 'ROUTE:' + core.inspect(this._getRouteInfo());

        if (!this.isERROR && !!router.getErrorRoute()) {
            // return new request
            this.isRendered = true;

            request = new Request({
                request: this.request,
                response: this.response,
                isForwarded: true,
                body: this.body,
                isERROR: true
            }, router.createUrl(router.getErrorRoute()));
            // pass exception response over parsed url query as query parameter
            // assign to exception
            request.parsedUrl.query.exception = response;
            // set status codes for new request
            request.setStatusCode(code);
            // return parsed request
            return request.parse();
        } else {
            this.addHeader('Content-Type', 'text/plain');
            return response;
        }
    }
1059181
def _http_error_handler(http_error):
    ''' '''
    message = str(http_error)
    if http_error.respbody is not None:
        message += '\n' + http_error.respbody.decode('utf-8-sig')
    raise AzureHttpError(message, http_error.status)
316538
function JSONAPIErrorHandler (err, req, res, next) {
  debug('Handling error(s) using custom jsonapi error handler')
  debug('Set Content-Type header to `application/vnd.api+json`')
  res.set('Content-Type', 'application/vnd.api+json')

  var errors = []
  var statusCode = err.statusCode ||
    err.status ||
    statusCodes.INTERNAL_SERVER_ERROR
  debug('Raw error object:', err)

  if (err.details && err.details.messages) {
    debug('Handling error as a validation error.')

    // This block is for handling validation errors.
    // Build up an array of validation errors.
    errors = Object.keys(err.details.messages).map(function (key) {
      return buildErrorResponse(
        statusCode,
        err.details.messages[key][0],
        err.details.codes[key][0],
        err.name,
        { pointer: 'data/attributes/' + key }
      )
    })
  } else if (err.message) {
    // convert specific errors below to validation errors.
    // These errors are from checks on the incoming payload to ensure it is
    // JSON API compliant. If we switch to being able to use the Accept header
    // to decide whether to handle the request as JSON API, these errors would
    // need to only be applied when the Accept header is `application/vnd.api+json`
    var additionalValidationErrors = [
      'JSON API resource object must contain `data` property',
      'JSON API resource object must contain `data.type` property',
      'JSON API resource object must contain `data.id` property'
    ]

    if (additionalValidationErrors.indexOf(err.message) !== -1) {
      debug('Recasting error as a validation error.')
      statusCode = statusCodes.UNPROCESSABLE_ENTITY
      err.code = 'presence'
      err.name = 'ValidationError'
    }

    debug('Handling invalid relationship specified in url')
    if (/Relation (.*) is not defined for (.*) model/.test(err.message)) {
      statusCode = statusCodes.BAD_REQUEST
      err.message = 'Bad Request'
      err.code = 'INVALID_INCLUDE_TARGET'
      err.name = 'BadRequest'
    }

    var errorSource = err.source && typeof err.source === 'object'
      ? err.source
      : {}
    if (errorStackInResponse) {
      // We do not want to mutate err.source, so we clone it first
      errorSource = _.clone(errorSource)
      errorSource.stack = err.stack
    }

    errors.push(
      buildErrorResponse(
        statusCode,
        err.message,
        err.code,
        err.name,
        errorSource,
        err.meta
      )
    )
  } else {
    debug(
      'Unable to determin error type. Treating error as a general 500 server error.'
    )
    // catch all server 500 error if we were unable to understand the error.
    errors.push(
      buildErrorResponse(
        statusCodes.INTERNAL_SERVER_ERROR,
        'Internal Server error',
        'GENERAL_SERVER_ERROR'
      )
    )
  }

  // send the errors and close out the response.
  debug('Sending error response')
  debug('Response Code:', statusCode)
  debug('Response Object:', { errors: errors })
  res.status(statusCode).send({ errors: errors }).end()
}
432846
public static boolean getHandleErrorWithFatalErrorPageFactory() {
		Boolean parameterValue = get().getBoolean(HANDLE_ERROR_WITH_FATAL_PAGE_FACTORY, null);
		if (parameterValue != null) {
			return parameterValue;
		}

		// fall-back to the old parameter value if the new value is not set.
		return get().getBoolean(HANDLE_ERROR_WITH_FATAL_PAGE_FACTORY_DEPRECATED, false);
	}
753671
def get_handler(self, *args, **options):
        
        handler = WSGIHandler()
        try:
            from django.contrib.staticfiles.handlers import StaticFilesHandler
        except ImportError:
            return handler
        use_static_handler = options.get('use_static_handler', True)
        insecure_serving = options.get('insecure_serving', False)
        if (settings.DEBUG and use_static_handler or
                (use_static_handler and insecure_serving)):
            handler = StaticFilesHandler(handler)
        return handler
652372
protected void sendError( String errText, HttpServletRequest request, HttpServletResponse response )
        throws IOException
    {
        InternalUtils.sendError( "PageFlow_Custom_Error", null, request, response,
                                 new Object[]{ getDisplayName(), errText } );
    }
994058
function onResError (ctx, err) {
  // nothing we can do here other
  // than delegate to the app-level
  // handler and log.
  if (ctx.headerSent || ctx._finished != null) {
    err.headerSent = ctx.headerSent
    err.context = ctx.toJSON()
    return err
  }

  // unset headers
  if (isFn(ctx.res.getHeaderNames)) {
    for (let name of ctx.res.getHeaderNames()) {
      if (!ON_ERROR_HEADER_REG.test(name)) ctx.res.removeHeader(name)
    }
  } else { // Node < 7.7
    let _headers = ctx.res._headers
    if (_headers) {
      // retain headers on error
      for (let name of Object.keys(_headers)) {
        if (!ON_ERROR_HEADER_REG.test(name)) delete _headers[name]
      }
    }
  }
  // support ENOENT to 404, default to 500
  if (err.code === 'ENOENT') ctx.status = 404
  else if (typeof err.status !== 'number' || !statuses[err.status]) ctx.status = 500
  else ctx.status = err.status

  ctx.set('x-content-type-options', 'nosniff')
  // support JSON error object: { error: 'BadRequest', message: 'Some bad request' }
  ctx.body = !isError(err) ? err : {
    error: err.error || err.name,
    message: err.expose ? err.message : statuses[ctx.status]
  }
  respond.call(ctx)
  return err
}
298318
private ControllerErrorHandler getContextErrorHandler(XmlWebApplicationContext context) {
        ControllerErrorHandler errorHandler = null;
        String[] names = context.getBeanNamesForType(ControllerErrorHandler.class);
        for (int i = 0; errorHandler == null && i < names.length; i++) {
            errorHandler = (ControllerErrorHandler) context.getBean(names[i]);
            Class<?> userClass = ClassUtils.getUserClass(errorHandler);
            if (userClass.isAnnotationPresent(Ignored.class)) {
                logger.debug("Ignored controllerErrorHandler: " + errorHandler);
                errorHandler = null;
                continue;
            }
        }
        return errorHandler;
    }
696976
@NotNull
	public static JSONAPIDocument<?> createErrorDocument(Iterable<? extends Error> errors) {
		JSONAPIDocument<?> result = new JSONAPIDocument();
		result.errors = errors;
		return result;
	}
255367
function handlePreResponseError(server) {
        server.ext('onPreResponse', function (request, reply) {
            var response = request.response;
            var originalResponse = response;
            var msg;

            // No error, keep going with the reply as normal
            if (!response.isBoom) { reply.continue(); return; }

            // we need to convert to AppError if it is not already
            if (!(response instanceof AppError)) {
                msg = response.message || (response + '');

                // if legit 404 be sure to use that code (happens with not found in /dist on local)
                if (msg.indexOf('404:') >= 0 ||
                    (response.output && response.output.payload &&
                    response.output.payload.statusCode === 404)) {

                    response = new AppError({
                        code: 'not_found',
                        msg: 'The resource ' + request.url.path + ' was not found'
                    });
                }
                else {
                    msg = response.message || (response + '');
                    if (response.data) { msg += ' : ' + response.data; }

                    log.info(msg);

                    response = new AppError({
                        code: response.code || 'api_error',
                        msg: msg,
                        err: response
                    });
                }
            }

            var code = response.code || 'unknown_error';
            var err = errorDecoder[code] || errorDecoder['unknown_error'];
            var url = request.path;

            if (err.httpErrorCode === 404) {
                trackingService.pageNotFound({
                    caller: request.caller,
                    url: routeHelper.getBaseUrl(request.app.name) + url
                });
            }
            else {
                log.error(request.method + ' ' + url + ' (' + err.friendlyMessage + ')',
                    { err: originalResponse }   );
            }

            //TODO: this hack sucks, but needed quick way to display error page; do better!
            if (pancakes.getContainer() === 'webserver') {

                // hack fix for issue when error on trust site
                if (request.app && request.app.name === 'trust') {
                    reply().redirect(routeHelper.getBaseUrl('contact') + '?notify=loginFailure');
                }
                // else show error pages
                else {
                    var errUrl = err.httpErrorCode === 404 ? '/error404' : '/error500';
                    pancakes.processRoute({ request: request, reply: reply, urlOverride: errUrl, returnCode: err.httpErrorCode });
                }
            }
            else {
                reply(Boom.create(err.httpErrorCode, err.friendlyMessage));
            }
        });
    }
1167156
private void errorHandling(CmsObject cms, HttpServletRequest req, HttpServletResponse res, Throwable t) {

        // remove the controller attribute from the request
        CmsFlexController.removeController(req);

        boolean canWrite = (!res.isCommitted() && !res.containsHeader("Location"));
        int status = -1;
        boolean isGuest = true;

        if (t instanceof ServletException) {
            ServletException s = (ServletException)t;
            if (s.getRootCause() != null) {
                t = s.getRootCause();
            }
            LOG.error(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
        } else if (t instanceof CmsSecurityException) {
            LOG.warn(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
            // access error - display login dialog
            if (canWrite) {
                try {
                    m_authorizationHandler.requestAuthorization(req, res, getLoginFormURL(req, res));
                } catch (IOException ioe) {
                    LOG.debug("Error calling authorization handler.", ioe);
                }
                return;
            }
        } else if (t instanceof CmsDbEntryNotFoundException) {
            LOG.warn(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
            // user or group does not exist
            status = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
            isGuest = false;
        } else if (t instanceof CmsVfsResourceNotFoundException) {
            LOG.warn(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
            // file not found - display 404 error.
            status = HttpServletResponse.SC_NOT_FOUND;
        } else if (t instanceof CmsException) {
            LOG.error(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
            if (t.getCause() != null) {
                t = t.getCause();
            }
        } else if (t.getClass().getName().equals("org.apache.catalina.connector.ClientAbortException")) {
            // only log to debug channel any exceptions caused by a client abort - this is tomcat specific
            LOG.debug(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
        } else {
            LOG.error(t.getLocalizedMessage() + " rendering URL " + req.getRequestURL(), t);
        }

        if (status < 1) {
            // error code not set - set "internal server error" (500)
            status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
        }
        res.setStatus(status);

        try {
            if ((cms != null) && (cms.getRequestContext().getCurrentUser() != null)) {
                isGuest = isGuest
                    && (cms.getRequestContext().getCurrentUser().isGuestUser()
                        || cms.userInGroup(
                            cms.getRequestContext().getCurrentUser().getName(),
                            OpenCms.getDefaultUsers().getGroupGuests()));
            }
        } catch (CmsException e) {
            // result is false
            LOG.error(e.getLocalizedMessage(), e);
        }

        if (canWrite) {
            res.setContentType("text/html");
            CmsRequestUtil.setNoCacheHeaders(res);
            if ((status != 404)
                && !isGuest
                && (cms != null)
                && (!CmsJsonPartFilter.isJsonRequest(req))
                && !cms.getRequestContext().getCurrentProject().isOnlineProject()) {
                try {
                    res.setStatus(HttpServletResponse.SC_OK);
                    res.getWriter().print(CmsErrorUI.getBootstrapPage(cms, t, req));
                } catch (IOException e) {
                    // can be ignored
                    LOG.error(e.getLocalizedMessage(), e);
                }
            } else {
                try {
                    res.sendError(status, t.toString());
                } catch (IOException e) {
                    // can be ignored
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        }
    }