log the exceptions thrown by email service in detail

This commit is contained in:
Pig Fang 2018-07-15 18:15:55 +08:00
parent 306650fcdd
commit 5a0908517e

View File

@ -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);
}