class Exceptions

Methods

__construct(Handler $handler)

Create a new exception handling configuration instance.

report(callable $using)

Register a reportable callback.

reportable(callable $reportUsing)

Register a reportable callback.

render(callable $using)

Register a renderable callback.

renderable(callable $renderUsing)

Register a renderable callback.

respond(callable $using)

Register a callback to prepare the final, rendered exception response.

throttle(callable $throttleUsing)

Specify the callback that should be used to throttle reportable exceptions.

map(Closure|string $from, Closure|string|null $to = null)

Register a new exception mapping.

level(string $type, string $level)

Set the log level for the given exception type.

context(Closure $contextCallback)

Register a closure that should be used to build exception context data.

dontReport(array|string $class)

Indicate that the given exception type should not be reported.

dontRetry(array|string $class)

Indicate that the given exception type should stop job retries.

dontReportWhen(Closure $dontReportWhen)

Register a callback to determine if an exception should not be reported.

dontRetryWhen(Closure $dontRetryWhen)

Register a callback to determine if an exception should stop job retries.

dontReportDuplicates()

Do not report duplicate exceptions.

dontFlash(array|string $attributes)

Indicate that the given attributes should never be flashed to the session on validation errors.

shouldRenderJsonWhen(callable $callback)

Register the callable that determines if the exception handler response should be JSON.

stopIgnoring(array|string $class)

Indicate that the given exception class should not be ignored.

truncateRequestExceptionsAt(int $length)

Set the truncation length for request exception messages.

dontTruncateRequestExceptions()

Disable truncation of request exception messages.

Details

at line 21
__construct(Handler $handler)

Create a new exception handling configuration instance.

Parameters

Handler $handler

at line 31
ReportableHandler report(callable $using)

Register a reportable callback.

Boot-only. The callback persists on the shared handler and affects exception reporting for every subsequent request and job in the worker.

Parameters

callable $using

Return Value

ReportableHandler

at line 42
ReportableHandler reportable(callable $reportUsing)

Register a reportable callback.

Boot-only. The callback persists on the shared handler and affects exception reporting for every subsequent request and job in the worker.

Parameters

callable $reportUsing

Return Value

ReportableHandler

at line 53
Exceptions render(callable $using)

Register a renderable callback.

Boot-only. The callback persists on the shared handler and affects exception rendering for every subsequent request in the worker.

Parameters

callable $using

Return Value

Exceptions

at line 66
Exceptions renderable(callable $renderUsing)

Register a renderable callback.

Boot-only. The callback persists on the shared handler and affects exception rendering for every subsequent request in the worker.

Parameters

callable $renderUsing

Return Value

Exceptions

at line 79
Exceptions respond(callable $using)

Register a callback to prepare the final, rendered exception response.

Boot-only. The callback replaces the shared handler's response callback for every subsequent request in the worker.

Parameters

callable $using

Return Value

Exceptions

at line 92
Exceptions throttle(callable $throttleUsing)

Specify the callback that should be used to throttle reportable exceptions.

Boot-only. The callback persists on the shared handler and affects exception reporting for every subsequent request and job in the worker.

Parameters

callable $throttleUsing

Return Value

Exceptions

at line 107
Exceptions map(Closure|string $from, Closure|string|null $to = null)

Register a new exception mapping.

Boot-only. The mapping persists on the shared handler and affects exception reporting and rendering for every subsequent request and job in the worker.

Parameters

Closure|string $from
Closure|string|null $to

Return Value

Exceptions

Exceptions

InvalidArgumentException

at line 123
Exceptions level(string $type, string $level)

Set the log level for the given exception type.

Boot-only. The level persists on the shared handler and affects how later exceptions of that type are logged in the worker.

Parameters

string $type
string $level

Return Value

Exceptions

at line 136
Exceptions context(Closure $contextCallback)

Register a closure that should be used to build exception context data.

Boot-only. The closure persists on the shared handler and runs for every subsequently logged exception in the worker.

Parameters

Closure $contextCallback

Return Value

Exceptions

at line 149
Exceptions dontReport(array|string $class)

Indicate that the given exception type should not be reported.

Boot-only. The exception types persist on the shared handler and affect exception reporting for every subsequent request and job in the worker.

Parameters

array|string $class

Return Value

Exceptions

at line 164
Exceptions dontRetry(array|string $class)

Indicate that the given exception type should stop job retries.

Boot-only. The exception types persist on the shared handler and affect every subsequently failed job in the worker.

Parameters

array|string $class

Return Value

Exceptions

at line 181
Exceptions dontReportWhen(Closure $dontReportWhen)

Register a callback to determine if an exception should not be reported.

Boot-only. The callback persists on the shared handler and affects exception reporting for every subsequent request and job in the worker.

Parameters

Closure $dontReportWhen

Return Value

Exceptions

at line 198
Exceptions dontRetryWhen(Closure $dontRetryWhen)

Register a callback to determine if an exception should stop job retries.

Boot-only. The callback persists on the shared handler and affects job retry decisions for every subsequent job in the worker.

Parameters

Closure $dontRetryWhen

Return Value

Exceptions

at line 211
Exceptions dontReportDuplicates()

Do not report duplicate exceptions.

Boot-only. The setting persists on the shared handler and applies to every subsequent request and job in the worker.

Return Value

Exceptions

at line 224
Exceptions dontFlash(array|string $attributes)

Indicate that the given attributes should never be flashed to the session on validation errors.

Boot-only. The attributes persist on the shared handler and are omitted from every subsequent validation redirect in the worker.

Parameters

array|string $attributes

Return Value

Exceptions

at line 237
Exceptions shouldRenderJsonWhen(callable $callback)

Register the callable that determines if the exception handler response should be JSON.

Boot-only. The callable replaces the shared handler's JSON check for every subsequent request in the worker.

Parameters

callable $callback

Return Value

Exceptions

at line 252
Exceptions stopIgnoring(array|string $class)

Indicate that the given exception class should not be ignored.

Boot-only. The exception lists persist on the shared handler and affect exception reporting for every subsequent request and job in the worker.

Parameters

array|string $class

Return Value

Exceptions

at line 265
Exceptions truncateRequestExceptionsAt(int $length)

Set the truncation length for request exception messages.

Boot-only. The global default persists for the worker lifetime across all coroutines; per-request truncation settings take precedence.

Parameters

int $length

Return Value

Exceptions

at line 278
Exceptions dontTruncateRequestExceptions()

Disable truncation of request exception messages.

Boot-only. The global default persists for the worker lifetime across all coroutines; per-request truncation settings take precedence.

Return Value

Exceptions