class FailOnException (View source)

Properties

protected Throwable, mixed): bool $callback

The truth-test callback to determine if the job should fail.

Methods

__construct(Throwable, mixed): bool|Throwable>> $callback)

Create a middleware instance.

Throwable, mixed): bool
failForExceptions(array $exceptions)

Indicate that the job should fail if it encounters the given exceptions.

mixed
handle(mixed $job, callable $next)

Mark the job as failed if an exception is thrown that passes a truth-test callback.

Details

__construct(Throwable, mixed): bool|Throwable>> $callback)

Create a middleware instance.

Parameters

Throwable, mixed): bool|Throwable>> $callback

protected Throwable, mixed): bool failForExceptions(array $exceptions)

Indicate that the job should fail if it encounters the given exceptions.

Parameters

array $exceptions

Return Value

Throwable, mixed): bool

mixed handle(mixed $job, callable $next)

Mark the job as failed if an exception is thrown that passes a truth-test callback.

Parameters

mixed $job
callable $next

Return Value

mixed

Exceptions

Throwable

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.