Skip to content

Commit 8e2c5ca

Browse files
authored
Pass exception to QueueFailedOver event (#57503)
1 parent f72673b commit 8e2c5ca

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Illuminate/Queue/Events/QueueFailedOver.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Illuminate\Queue\Events;
44

5+
use Throwable;
6+
57
class QueueFailedOver
68
{
79
/**
@@ -13,6 +15,7 @@ class QueueFailedOver
1315
public function __construct(
1416
public ?string $connectionName,
1517
public mixed $command,
18+
public Throwable $exception,
1619
) {
1720
}
1821
}

src/Illuminate/Queue/FailoverQueue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function push($job, $data = '', $queue = null)
9595
} catch (Throwable $e) {
9696
$lastException = $e;
9797

98-
$this->events->dispatch(new QueueFailedOver($connection, $job));
98+
$this->events->dispatch(new QueueFailedOver($connection, $job, $e));
9999
}
100100
}
101101

@@ -143,7 +143,7 @@ public function later($delay, $job, $data = '', $queue = null)
143143
} catch (Throwable $e) {
144144
$lastException = $e;
145145

146-
$this->events->dispatch(new QueueFailedOver($connection, $job));
146+
$this->events->dispatch(new QueueFailedOver($connection, $job, $e));
147147
}
148148
}
149149

0 commit comments

Comments
 (0)