vendor/laravel/framework/src/Illuminate/Queue/Worker.php
/**
     * Handle an exception that occurred while the job was running.
     *
     * @param  string  $connectionName
     * @param  \Illuminate\Contracts\Queue\Job  $job
     * @param  \Illuminate\Queue\WorkerOptions  $options
     * @param  \Exception  $e
     * @return void
     *
     * @throws \Exception
     */
Handle an exception that occurred while the job was running.

@throws \Exception
Handle an exception that occurred while the job was running . @throws \ Exception
protected function handleJobException($connectionName, $job, WorkerOptions $options, $e)
    {
        try {
            if (! $job->hasFailed()) {
                $this->markJobAsFailedIfWillExceedMaxAttempts(
                    $connectionName, $job, (int) $options->maxTries, $e
                );
            }
            $this->raiseExceptionOccurredJobEvent(
                $connectionName, $job, $e
            );
        } finally {
            if (! $job->isDeleted() && ! $job->isReleased() && ! $job->hasFailed()) {
                $job->release($options->delay);
            }
        }
        throw $e;
    }
protected function handleJobException ( $ connectionName , $ job , WorkerOptions $ options , $ e ) { try { if ( ! $ job -> hasFailed ( ) ) { $ this -> markJobAsFailedIfWillExceedMaxAttempts ( $ connectionName , $ job , ( int ) $ options -> maxTries , $ e ) ; } $ this -> raiseExceptionOccurredJobEvent ( $ connectionName , $ job , $ e ) ; } finally { if ( ! $ job -> isDeleted ( ) && ! $ job -> isReleased ( ) && ! $ job -> hasFailed ( ) ) { $ job -> release ( $ options -> delay ) ; } } throw $ e ; }
Handle an exception that occurred while the job was running.
Handle an exception that occurred while the job was running .
// First, we will go ahead and mark the job as failed if it will exceed the maximum // attempts it is allowed to run the next time we process it. If so we will just // go ahead and mark it as failed now so we do not have to release this again. // If we catch an exception, we will attempt to release the job back onto the queue // so it is not lost entirely. This'll let the job be retried at a later time by // another listener (or this same one). We will re-throw this exception after.