Track job errors in the log

This commit is contained in:
Hillel Coren 2017-03-09 14:23:30 +02:00
parent 8627f9d745
commit ca00ee19c6
2 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,7 @@
namespace App\Listeners;
use Illuminate\Queue\Events\JobExceptionOccurred;
use App\Events\InvoiceInvitationWasViewed;
use App\Events\InvoiceWasCreated;
use App\Events\InvoiceWasUpdated;
@ -149,4 +150,9 @@ class InvoiceListener
$invoice->updateBalances($adjustment);
$invoice->updatePaidStatus();
}
public function jobFailed(JobExceptionOccurred $exception)
{
Utils::logError($exception->exception);
}
}

View File

@ -190,10 +190,16 @@ class EventServiceProvider extends ServiceProvider
'App\Listeners\ActivityListener@deletedExpense',
],
'Illuminate\Queue\Events\JobExceptionOccurred' => [
'App\Listeners\InvoiceListener@jobFailed'
]
/*
// Update events
\Codedge\Updater\Events\UpdateAvailable::class => [
\Codedge\Updater\Listeners\SendUpdateAvailableNotification::class,
],
*/
];
/**