From 2a35e83939e482f8e95a09f69dc166ef4ec9d696 Mon Sep 17 00:00:00 2001 From: printempw Date: Fri, 6 Jul 2018 19:00:07 +0800 Subject: [PATCH] Log the exceptions thrown by email service in detail --- app/Http/Controllers/AuthController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/AuthController.php b/app/Http/Controllers/AuthController.php index d2a6b063..a0ed0266 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -195,7 +195,10 @@ class AuthController extends Controller }); Log::info("[Password Reset] Mail has been sent to [{$request->input('email')}] with token [$token]"); - } catch(\Exception $e) { + } catch (\Exception $e) { + // Write the exception to log + app(\Illuminate\Foundation\Exceptions\Handler::class)->report($e); + return json(trans('auth.mail.failed', ['msg' => $e->getMessage()]), 2); }