I'm trying to get the ID or UUID of a failed job by calling depending on the failed()
method on the Job class but I'm getting an error about the job being null
Here's my code:
public function failed(Throwable $exception)
{
$uuid = $this->job->uuid();
$id = $this->job->getJobId();
info("Job UUID: {$uuid}");
info("Job ID: {$id}");
$this->rescheduleImport();
}
I'm trying to understand why this happens and an alternative way to go about this.