romanzipp / Laravel-Queue-Monitor

Monitoring Laravel Jobs with your Database
https://packagist.org/packages/romanzipp/laravel-queue-monitor
MIT License
693 stars 91 forks source link

Argument 3 passed to QueueMonitor::jobFinished() must implement interface Throwable or be null, string given #71

Closed idealerror closed 3 years ago

idealerror commented 3 years ago

Hello,

When a job fails, it's failing with this error:

Argument 3 passed to romanzipp\QueueMonitor\Services\QueueMonitor::jobFinished() must implement interface Throwable or be null, string given, called in /var/www/html/vendor/romanzipp/laravel-queue-monitor/src/Services/QueueMonitor.php on line 70

Any ideas why this is happening? Possibly due to this an exception where I'm failing the job myself?

try {
            $output = DB::connection()->select($query);
        } catch(\Illuminate\Database\QueryException $ex){
            $this->fail($ex->getMessage());
        }
romanzipp commented 3 years ago

The Laravel fail method expects an exception (instance of Throwable) as first argument. You are only providing a string.