1
0
Fork 0
mirror of https://github.com/archtechx/jobpipeline.git synced 2025-12-12 18:44:04 +00:00

fix: handle errors in closures

This commit is contained in:
Julian Hundeloh 2024-11-08 08:47:31 +01:00 committed by GitHub
parent 8b793e0cf2
commit f1f82aa5d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -72,7 +72,7 @@ class JobPipeline implements ShouldQueue
try {
$result = app()->call($job);
} 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]);
} else {
throw $exception;