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.

beforeResponding(callable $callback)

Register a callback before final exception response customization.

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 24
__construct(Handler $handler)

Create a new exception handling configuration instance.

Parameters

Handler $handler

at line 34
ReportableHandler report(callable $using)

Register a reportable callback.

On the application's worker-shared handler, the callback affects exception reporting for every subsequent request and job in the worker.

Parameters

callable $using

Return Value

ReportableHandler

at line 45
ReportableHandler reportable(callable $reportUsing)

Register a reportable callback.

On the application's worker-shared handler, the callback affects exception reporting for every subsequent request and job in the worker.

Parameters

callable $reportUsing

Return Value

ReportableHandler

at line 58
Exceptions render(callable $using)

Register a renderable callback.

On the application's worker-shared handler, the callback affects exception rendering for every subsequent request in the worker.

Parameters

callable $using

Return Value

Exceptions

at line 73
Exceptions renderable(callable $renderUsing)

Register a renderable callback.

On the application's worker-shared handler, the callback affects exception rendering for every subsequent request in the worker.

Parameters

callable $renderUsing

Return Value

Exceptions

at line 88
Exceptions respond(callable $using)

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

On the application's worker-shared handler, the callback replaces the response callback for every subsequent request in the worker.

Parameters

callable $using

Return Value

Exceptions

at line 104
Exceptions beforeResponding(callable $callback)

Register a callback before final exception response customization.

On the application's worker-shared handler, the callback runs for every subsequent exception response in the worker. Callback return values are ignored.

Parameters

callable $callback

Return Value

Exceptions

at line 119
Exceptions throttle(callable $throttleUsing)

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

On the application's worker-shared handler, the callback affects exception reporting for every subsequent request and job in the worker.

Parameters

callable $throttleUsing

Return Value

Exceptions

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

Register a new exception mapping.

On the application's worker-shared handler, the mapping 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 153
Exceptions level(string $type, string $level)

Set the log level for the given exception type.

On the application's worker-shared handler, the level affects how later exceptions of that type are logged in the worker.

Parameters

string $type
string $level

Return Value

Exceptions

at line 168
Exceptions context(Closure $contextCallback)

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

On the application's worker-shared handler, the closure runs for every subsequently logged exception in the worker.

Parameters

Closure $contextCallback

Return Value

Exceptions

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

Indicate that the given exception type should not be reported.

On the application's worker-shared handler, the exception types affect exception reporting for every subsequent request and job in the worker.

Parameters

array|string $class

Return Value

Exceptions

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

Indicate that the given exception type should stop job retries.

On the application's worker-shared handler, the exception types affect every subsequently failed job in the worker.

Parameters

array|string $class

Return Value

Exceptions

at line 218
Exceptions dontReportWhen(Closure $dontReportWhen)

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

On the application's worker-shared handler, the callback affects exception reporting for every subsequent request and job in the worker.

Parameters

Closure $dontReportWhen

Return Value

Exceptions

at line 236
Exceptions dontRetryWhen(Closure $dontRetryWhen)

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

On the application's worker-shared handler, the callback affects job retry decisions for every subsequent job in the worker.

Parameters

Closure $dontRetryWhen

Return Value

Exceptions

at line 251
Exceptions dontReportDuplicates()

Do not report duplicate exceptions.

On the application's worker-shared handler, the setting applies to every subsequent request and job in the worker.

Return Value

Exceptions

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

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

On the application's worker-shared handler, the attributes are omitted from every subsequent validation redirect in the worker.

Parameters

array|string $attributes

Return Value

Exceptions

at line 281
Exceptions shouldRenderJsonWhen(callable $callback)

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

On the application's worker-shared handler, the callable replaces the JSON check for every subsequent request in the worker.

Parameters

callable $callback

Return Value

Exceptions

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

Indicate that the given exception class should not be ignored.

On the application's worker-shared handler, the exception lists affect exception reporting for every subsequent request and job in the worker.

Parameters

array|string $class

Return Value

Exceptions

at line 312
Exceptions truncateRequestExceptionsAt(int $length)

Set the truncation length for request exception messages.

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 328
Exceptions dontTruncateRequestExceptions()

Disable truncation of request exception messages.

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

Return Value

Exceptions