Handler

class Handler implements ExceptionHandler (View source)

Properties

protected Container $container The container implementation.
protected array $dontReport A list of the exception types that should not be reported.

Methods

void __construct(Container $container)

Create a new exception handler instance.

void report(Exception $e)

Report or log an exception.

bool shouldReport(Exception $e)

Determine if the exception should be reported.

bool shouldntReport(Exception $e)

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

Exception prepareException(Exception $e)

Prepare exception for rendering.

Response render(Request $request, Exception $e)

Render an exception into a response.

Response prepareResponse(Request $request, Exception $e)

Prepare response containing exception render.

Response toIlluminateResponse(Response $response, Exception $e)

Map exception into an illuminate response.

void renderForConsole(OutputInterface $output, Exception $e)

Render an exception to the console.

Response renderHttpException(HttpException $e)

Render the given HttpException.

Response convertValidationExceptionToResponse(ValidationException $e, Request $request)

Create a response object from the given validation exception.

Response convertExceptionToResponse(Exception $e)

Create a Symfony response for the given exception.

bool isHttpException(Exception $e)

Determine if the given exception is an HTTP exception.

Details

void __construct(Container $container)

Create a new exception handler instance.

Parameters

Container $container

Return Value

void

void report(Exception $e)

Report or log an exception.

Parameters

Exception $e

Return Value

void

Exceptions

Exception

bool shouldReport(Exception $e)

Determine if the exception should be reported.

Parameters

Exception $e

Return Value

bool

protected bool shouldntReport(Exception $e)

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

Parameters

Exception $e

Return Value

bool

protected Exception prepareException(Exception $e)

Prepare exception for rendering.

Parameters

Exception $e

Return Value

Exception

Response render(Request $request, Exception $e)

Render an exception into a response.

Parameters

Request $request
Exception $e

Return Value

Response

protected Response prepareResponse(Request $request, Exception $e)

Prepare response containing exception render.

Parameters

Request $request
Exception $e

Return Value

Response

protected Response toIlluminateResponse(Response $response, Exception $e)

Map exception into an illuminate response.

Parameters

Response $response
Exception $e

Return Value

Response

void renderForConsole(OutputInterface $output, Exception $e)

Render an exception to the console.

Parameters

OutputInterface $output
Exception $e

Return Value

void

protected Response renderHttpException(HttpException $e)

Render the given HttpException.

Parameters

HttpException $e

Return Value

Response

protected Response convertValidationExceptionToResponse(ValidationException $e, Request $request)

Create a response object from the given validation exception.

Parameters

ValidationException $e
Request $request

Return Value

Response

protected Response convertExceptionToResponse(Exception $e)

Create a Symfony response for the given exception.

Parameters

Exception $e

Return Value

Response

protected bool isHttpException(Exception $e)

Determine if the given exception is an HTTP exception.

Parameters

Exception $e

Return Value

bool

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.3/Illuminate/Foundation/Exceptions/Handler.html