Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] Update CallQueuedClosure to catch Throwable/Error (#36159)
* Update CallQueuedClosure to catch Throwable/Error - Laravel Version: 8.26.1 - PHP Version: 8.0.0 ### Description: Queued closures that throw an Error will throw again when handled by CallQueuedClosure@failed, as its currently type-hinted for Exceptions only. ### Steps To Reproduce: ```php Bus::chain([ function () { SomeClassThatDoesntExist::throw(); } ])->dispatch(); ``` The above will first throw `Error Class "SomeClassThatDoesntExist" not found`. The queue will attempt to handle it and throw again: `TypeError Illuminate\Queue\CallQueuedClosure::failed(): Argument #1 ($e) must be of type Exception, Error given, called in /var/task/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php on line 261` * style: styleci fixes * Update CallQueuedClosure.php Co-authored-by: Taylor Otwell <[email protected]>
- Loading branch information