master

laravel/framework

Last updated at: 29/12/2023 09:24

JobExceptionOccurred.php

TLDR

The JobExceptionOccurred.php file defines a class called JobExceptionOccurred in the Illuminate\Queue\Events namespace. This class represents an event where an exception occurs while processing a job in a queue.

Classes

JobExceptionOccurred

The JobExceptionOccurred class represents an event where an exception occurs while processing a job in a queue. It has the following properties:

  • connectionName (string): The name of the connection the job was being processed on.
  • job (\Illuminate\Contracts\Queue\Job): The job instance that was being processed.
  • exception (\Throwable): The exception instance that occurred during the job processing.

The class has a constructor method that accepts the connection name, job instance, and exception instance as parameters and assigns them to the corresponding properties.

<?php

namespace Illuminate\Queue\Events;

class JobExceptionOccurred
{
    /**
     * The connection name.
     *
     * @var string
     */
    public $connectionName;

    /**
     * The job instance.
     *
     * @var \Illuminate\Contracts\Queue\Job
     */
    public $job;

    /**
     * The exception instance.
     *
     * @var \Throwable
     */
    public $exception;

    /**
     * Create a new event instance.
     *
     * @param  string  $connectionName
     * @param  \Illuminate\Contracts\Queue\Job  $job
     * @param  \Throwable  $exception
     * @return void
     */
    public function __construct($connectionName, $job, $exception)
    {
        $this->job = $job;
        $this->exception = $exception;
        $this->connectionName = $connectionName;
    }
}