Illuminate\Queue\Worker::failJob PHP Method

failJob() protected method

Mark the given job as failed and raise the relevant event.
protected failJob ( string $connectionName, Illuminate\Contracts\Queue\Job $job, Exception $e ) : void
$connectionName string
$job Illuminate\Contracts\Queue\Job
$e Exception
return void
    protected function failJob($connectionName, $job, $e)
    {
        if ($job->isDeleted()) {
            return;
        }
        try {
            // If the job has failed, we will delete it, call the "failed" method and then call
            // an event indicating the job has failed so it can be logged if needed. This is
            // to allow every developer to better keep monitor of their failed queue jobs.
            $job->delete();
            $job->failed($e);
        } finally {
            $this->raiseFailedJobEvent($connectionName, $job, $e);
        }
    }