From 5a0908517ee599a920999a23888a81c96222ae8a Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 15 Jul 2018 18:15:55 +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 64226415..738d1ad9 100644 --- a/app/Http/Controllers/AuthController.php +++ b/app/Http/Controllers/AuthController.php @@ -188,7 +188,10 @@ class AuthController extends Controller Mail::to($request->input('email'))->send(new ForgotPassword($user->uid, $token)); 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); }