Notify on queue errors

This commit is contained in:
Hillel Coren 2017-03-09 20:17:15 +02:00
parent d854269228
commit be10b80fbf

View File

@ -153,6 +153,14 @@ class InvoiceListener
public function jobFailed(JobExceptionOccurred $exception)
{
if ($errorEmail = env('ERROR_EMAIL')) {
\Mail::raw(print_r($exception->data, true), function ($message) use ($errorEmail) {
$message->to($errorEmail)
->from(CONTACT_EMAIL)
->subject('Job failed');
});
}
Utils::logError($exception->exception);
}
}