October\Rain\Foundation\Exception\Handler

Overview

Handler is the core exception handler

Extends
  • Illuminate\Foundation\Exceptions\Handler
Implements
  • Illuminate\Contracts\Debug\ExceptionHandler

Protected Properties

protected array $dontReport

dontReport these exception types.

protected array $handlers

handlers for registered exceptions.

Show inherited protected properties

Inherited Protected Properties

  • $container - The container implementation. (defined in Illuminate\Foundation\Exceptions\Handler)
  • $reportCallbacks - The callbacks that should be used during reporting. (defined in Illuminate\Foundation\Exceptions\Handler)
  • $levels - A map of exceptions with their corresponding custom log levels. (defined in Illuminate\Foundation\Exceptions\Handler)
  • $renderCallbacks - The callbacks that should be used during rendering. (defined in Illuminate\Foundation\Exceptions\Handler)
  • $exceptionMap - The registered exception mappings. (defined in Illuminate\Foundation\Exceptions\Handler)
  • $internalDontReport - A list of the internal exception types that should not be reported. (defined in Illuminate\Foundation\Exceptions\Handler)
  • $dontFlash - A list of the inputs that are never flashed for validation exceptions. (defined in Illuminate\Foundation\Exceptions\Handler)

Public Methods

public error()

public error($callback): void

public render()

public render(
    Illuminate\Http\Request $request,
    Throwable $exception
): Illuminate\Http\Response 

render an exception into an HTTP response.

public report()

public report(Throwable $exception): void 

report or log an exception.

This is a great spot to send exceptions to Sentry, Bugsnag, etc.

Show inherited public methods

Inherited Public Methods

  • __construct() - Create a new exception handler instance. (defined in Illuminate\Foundation\Exceptions\Handler)
  • ignore() - Indicate that the given exception type should not be reported. (defined in Illuminate\Foundation\Exceptions\Handler)
  • level() - Set the log level for the given exception type. (defined in Illuminate\Foundation\Exceptions\Handler)
  • map() - Register a new exception mapping. (defined in Illuminate\Foundation\Exceptions\Handler)
  • register() - Register the exception handling callbacks for the application. (defined in Illuminate\Foundation\Exceptions\Handler)
  • renderForConsole() - Render an exception to the console. (defined in Illuminate\Foundation\Exceptions\Handler)
  • renderable() - Register a renderable callback. (defined in Illuminate\Foundation\Exceptions\Handler)
  • reportable() - Register a reportable callback. (defined in Illuminate\Foundation\Exceptions\Handler)
  • shouldReport() - Determine if the exception should be reported. (defined in Illuminate\Foundation\Exceptions\Handler)

Protected Methods

protected context()

protected context(): array 

context is the the default context variables for logging.

protected getStatusCode()

protected getStatusCode(Exception $exception): int 

getStatusCode checks if the exception implements the HttpExceptionInterface, or returns as generic 500 error code for a server side error.

protected hasBootedEvents()

protected hasBootedEvents(): bool 

hasBootedEvents checks if we can broadcast events

protected prepareException()

protected prepareException($e): void

prepareException for rendering.

protected renderViaCallbacks()

protected renderViaCallbacks(Illuminate\Http\Request $request, $e): mixed 

renderViaCallbacks tries to render a response from request and exception via render callbacks.

Show inherited protected methods

Inherited Protected Methods

  • buildExceptionContext() - Create the context array for logging the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
  • closureParameterTypes() - Get the class names / types of the parameters of the given Closure. (defined in Illuminate\Foundation\Exceptions\Handler)
  • convertExceptionToArray() - Convert the given exception to an array. (defined in Illuminate\Foundation\Exceptions\Handler)
  • convertExceptionToResponse() - Create a Symfony response for the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
  • convertValidationExceptionToResponse() - Create a response object from the given validation exception. (defined in Illuminate\Foundation\Exceptions\Handler)
  • exceptionContext() - Get the default exception context variables for logging. (defined in Illuminate\Foundation\Exceptions\Handler)
  • firstClosureParameterType() - Get the class name of the first parameter of the given Closure. (defined in Illuminate\Foundation\Exceptions\Handler)
  • firstClosureParameterTypes() - Get the class names of the first parameter of the given Closure, including union types. (defined in Illuminate\Foundation\Exceptions\Handler)
  • getHttpExceptionView() - Get the view used to render HTTP exceptions. (defined in Illuminate\Foundation\Exceptions\Handler)
  • invalid() - Convert a validation exception into a response. (defined in Illuminate\Foundation\Exceptions\Handler)
  • invalidJson() - Convert a validation exception into a JSON response. (defined in Illuminate\Foundation\Exceptions\Handler)
  • isHttpException() - Determine if the given exception is an HTTP exception. (defined in Illuminate\Foundation\Exceptions\Handler)
  • mapException() - Map the exception using a registered mapper if possible. (defined in Illuminate\Foundation\Exceptions\Handler)
  • prepareJsonResponse() - Prepare a JSON response for the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
  • prepareResponse() - Prepare a response for the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
  • registerErrorViewPaths() - Register the error template hint paths. (defined in Illuminate\Foundation\Exceptions\Handler)
  • renderExceptionContent() - Get the response content for the given exception. (defined in Illuminate\Foundation\Exceptions\Handler)
  • renderExceptionResponse() - Render a default exception response if any. (defined in Illuminate\Foundation\Exceptions\Handler)
  • renderExceptionWithCustomRenderer() - Render an exception to a string using the registered ExceptionRenderer. (defined in Illuminate\Foundation\Exceptions\Handler)
  • renderExceptionWithSymfony() - Render an exception to a string using Symfony. (defined in Illuminate\Foundation\Exceptions\Handler)
  • renderHttpException() - Render the given HttpException. (defined in Illuminate\Foundation\Exceptions\Handler)
  • shouldReturnJson() - Determine if the exception handler response should be JSON. (defined in Illuminate\Foundation\Exceptions\Handler)
  • shouldntReport() - Determine if the exception is in the "do not report" list. (defined in Illuminate\Foundation\Exceptions\Handler)
  • toIlluminateResponse() - Map the given exception into an Illuminate response. (defined in Illuminate\Foundation\Exceptions\Handler)
  • unauthenticated() - Convert an authentication exception into a response. (defined in Illuminate\Foundation\Exceptions\Handler)