class Handler extends Handler

Properties

protected array $dontReport

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

protected array $handlers

All of the register exception handlers.

Methods

void
report(Throwable $e)

Report or log an exception.

Response
render(Request $request, Throwable $e)

Render an exception into an HTTP response.

int
getStatusCode(Throwable $exception)

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

array
context()

Get the default context variables for logging.

void
error(Closure $callback)

Register an application error handler.

callCustomHandlers(Throwable $exception, bool $fromConsole = false)

Handle the given exception.

bool
handlesException(Closure $handler, Throwable $exception)

Determine if the given handler handles this exception.

bool
hints(ReflectionFunction $reflection, Throwable $exception)

Determine if the given handler type hints the exception.

Details

at line 51
void report(Throwable $e)

Report or log an exception.

Parameters

Throwable $e

Return Value

void

Exceptions

Throwable

at line 101
Response render(Request $request, Throwable $e)

Render an exception into an HTTP response.

Parameters

Request $request
Throwable $e

Return Value

Response

at line 131
protected int getStatusCode(Throwable $exception)

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

Parameters

Throwable $exception

Return Value

int

at line 151
protected array context()

Get the default context variables for logging.

Return Value

array

at line 166
void error(Closure $callback)

Register an application error handler.

Parameters

Closure $callback

Return Value

void

at line 177
protected callCustomHandlers(Throwable $exception, bool $fromConsole = false)

Handle the given exception.

Parameters

Throwable $exception
bool $fromConsole

at line 214
protected bool handlesException(Closure $handler, Throwable $exception)

Determine if the given handler handles this exception.

Parameters

Closure $handler
Throwable $exception

Return Value

bool

at line 228
protected bool hints(ReflectionFunction $reflection, Throwable $exception)

Determine if the given handler type hints the exception.

Parameters

ReflectionFunction $reflection
Throwable $exception

Return Value

bool