diff --git a/src/Illuminate/Queue/InteractsWithQueue.php b/src/Illuminate/Queue/InteractsWithQueue.php index 0ea699a2923a..bddd216f36ba 100644 --- a/src/Illuminate/Queue/InteractsWithQueue.php +++ b/src/Illuminate/Queue/InteractsWithQueue.php @@ -38,13 +38,13 @@ public function delete() /** * Fail the job from the queue. * - * @param \Throwable $e + * @param \Throwable $exception * @return void */ - public function fail($e) + public function fail($exception = null) { if ($this->job) { - return $this->job->failed($e); + return $this->job->failed($exception ?: new ManuallyFailedException); } } diff --git a/src/Illuminate/Queue/ManuallyFailedException.php b/src/Illuminate/Queue/ManuallyFailedException.php new file mode 100644 index 000000000000..30ac0ad3bc80 --- /dev/null +++ b/src/Illuminate/Queue/ManuallyFailedException.php @@ -0,0 +1,9 @@ +