From d091ea0e0fe6b092febdaa1862ea8dd19a6a4775 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 9 Feb 2017 13:08:48 +0200 Subject: [PATCH] Throw exception if email job fails --- app/Ninja/Mailers/Mailer.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Ninja/Mailers/Mailer.php b/app/Ninja/Mailers/Mailer.php index c8a29f30ab32..5b4d34c23302 100644 --- a/app/Ninja/Mailers/Mailer.php +++ b/app/Ninja/Mailers/Mailer.php @@ -119,8 +119,11 @@ class Mailer $error = trans('texts.postmark_error', ['link' => link_to('https://status.postmarkapp.com/')]); Utils::logError($error); - // TODO throw the exception once all emails are sent using the queue - return $error; + if (config('queue.default') === 'sync') { + return $error; + } else { + throw $exception; + } } $response = $response->getBody()->getContents();