mirror of
https://github.com/archtechx/jobpipeline.git
synced 2025-12-13 02:34:04 +00:00
fix: handle errors in closures
This commit is contained in:
parent
8b793e0cf2
commit
f1f82aa5d9
1 changed files with 1 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ class JobPipeline implements ShouldQueue
|
||||||
try {
|
try {
|
||||||
$result = app()->call($job);
|
$result = app()->call($job);
|
||||||
} catch (Throwable $exception) {
|
} catch (Throwable $exception) {
|
||||||
if (method_exists(get_class($job[0]), 'failed')) {
|
if (is_array($job) && method_exists(get_class($job[0]), 'failed')) {
|
||||||
call_user_func_array([$job[0], 'failed'], [$exception]);
|
call_user_func_array([$job[0], 'failed'], [$exception]);
|
||||||
} else {
|
} else {
|
||||||
throw $exception;
|
throw $exception;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue