Handler

Implements

Uses

Properties

protected

$container Container

The container implementation.

Default: null
protected

$dontReport array>

A list of the exception types that are not reported.

Default: []
protected

$reportCallbacks Illuminate\...\ReportableHandler[]

The callbacks that should be used during reporting.

Default: []
protected

$levels array

A map of exceptions with their corresponding custom log levels.

Default: []
protected

$renderCallbacks Closure[]

The callbacks that should be used during rendering.

Default: []
protected

$exceptionMap array

The registered exception mappings.

Default: []
protected

$internalDontReport array>

A list of the internal exception types that should not be reported.

Default: array
protected

$dontFlash array

A list of the inputs that are never flashed for validation exceptions.

Default: array

Methods

public

__construct ( Container $container ) : void

Create a new exception handler instance.

Parameters

public

register ( ) : void

Register the exception handling callbacks for the application.

public

reportable ( callable $reportUsing ) : ReportableHandler

Register a reportable callback.

Parameters

  • $reportUsing callable
public

renderable ( callable $renderUsing ) : $this

Register a renderable callback.

Parameters

  • $renderUsing callable
public

map ( $from , $to ) : $this

Register a new exception mapping.

Parameters

public

ignore ( string $class ) : $this

Indicate that the given exception type should not be reported.

Parameters

  • $class string
public

level ( $type , $level ) : $this

Set the log level for the given exception type.

Parameters

  • $type class-string<\Throwable>
  • $level Psr\...\LogLevel::*
public

report ( Throwable $e ) : void

Report or log an exception.

Parameters

protected

reportThrowable ( Throwable $e ) : void

Reports error based on report method on exception or to logger.

Parameters

public

shouldReport ( Throwable $e ) : bool

Determine if the exception should be reported.

Parameters

protected

shouldntReport ( Throwable $e ) : bool

Determine if the exception is in the "do not report" list.

Parameters

public

stopIgnoring ( string $exception ) : $this

Remove the given exception class from the list of exceptions that should be ignored.

Parameters

  • $exception string
protected

buildExceptionContext ( Throwable $e ) : array

Create the context array for logging the given exception.

Parameters

protected

exceptionContext ( Throwable $e ) : array

Get the default exception context variables for logging.

Parameters

protected

context ( ) : array

Get the default context variables for logging.

public

render ( $request , Throwable $e ) : Symfony\...\Response

Render an exception into an HTTP response.

Parameters

protected

prepareException ( Throwable $e ) : Throwable

Prepare exception for rendering.

Parameters

protected

mapException ( Throwable $e ) : Throwable

Map the exception using a registered mapper if possible.

Parameters

protected

renderViaCallbacks ( $request , Throwable $e ) : mixed

Try to render a response from request and exception via render callbacks.

Parameters

protected

renderExceptionResponse ( $request , Throwable $e ) : Response |RedirectResponse

Render a default exception response if any.

Parameters

protected

unauthenticated ( $request , AuthenticationException $exception ) : Response |RedirectResponse

Convert an authentication exception into a response.

Parameters

protected

convertValidationExceptionToResponse ( ValidationException $e , $request ) : Symfony\...\Response

Create a response object from the given validation exception.

Parameters

protected

invalid ( $request , ValidationException $exception ) : Response |RedirectResponse

Convert a validation exception into a response.

Parameters

protected

invalidJson ( $request , ValidationException $exception ) : JsonResponse

Convert a validation exception into a JSON response.

Parameters

protected

shouldReturnJson ( $request , Throwable $e ) : bool

Determine if the exception handler response should be JSON.

Parameters

protected

prepareResponse ( $request , Throwable $e ) : Response |RedirectResponse

Prepare a response for the given exception.

Parameters

protected

convertExceptionToResponse ( Throwable $e ) : Symfony\...\Response

Create a Symfony response for the given exception.

Parameters

protected

renderExceptionContent ( Throwable $e ) : string

Get the response content for the given exception.

Parameters

protected

renderExceptionWithCustomRenderer ( Throwable $e ) : string

Render an exception to a string using the registered ExceptionRenderer.

Parameters

protected

renderExceptionWithSymfony ( Throwable $e , $debug ) : string

Render an exception to a string using Symfony.

Parameters

protected

renderHttpException ( Symfony\...\HttpExceptionInterface $e ) : Symfony\...\Response

Render the given HttpException.

Parameters

  • $e Symfony\...\HttpExceptionInterface
protected

registerErrorViewPaths ( ) : void

Register the error template hint paths.

protected

getHttpExceptionView ( Symfony\...\HttpExceptionInterface $e ) : string|null

Get the view used to render HTTP exceptions.

Parameters

  • $e Symfony\...\HttpExceptionInterface
protected

toIlluminateResponse ( $response , Throwable $e ) : Response |RedirectResponse

Map the given exception into an Illuminate response.

Parameters

protected

prepareJsonResponse ( $request , Throwable $e ) : JsonResponse

Prepare a JSON response for the given exception.

Parameters

protected

convertExceptionToArray ( Throwable $e ) : array

Convert the given exception to an array.

Parameters

public

renderForConsole ( $output , Throwable $e ) : void

Render an exception to the console.

Parameters

  • $output Symfony\...\OutputInterface
  • $e Throwable
protected

isHttpException ( Throwable $e ) : bool

Determine if the given exception is an HTTP exception.

Parameters