From f1750e3c35106c0f6a93059bace9fa84d4cc05d0 Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 11 Feb 2016 12:54:16 +0100 Subject: [PATCH] Will inform about the logged in user --- app/Exceptions/Handler.php | 3 +++ resources/views/emails/error-html.twig | 6 ++++++ resources/views/emails/error.twig | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 0a5c1a01db..110ac12f83 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -12,6 +12,7 @@ use Log; use Mail; use Swift_TransportException; use Symfony\Component\HttpKernel\Exception\HttpException; +use Auth; /** * Class Handler @@ -57,6 +58,8 @@ class Handler extends ExceptionHandler 'file' => $exception->getFile(), 'line' => $exception->getLine(), 'code' => $exception->getCode(), + 'loggedIn' => Auth::check(), + 'user' => Auth::user(), ]; Mail::send( diff --git a/resources/views/emails/error-html.twig b/resources/views/emails/error-html.twig index 9893172ec2..83d3b084ee 100644 --- a/resources/views/emails/error-html.twig +++ b/resources/views/emails/error-html.twig @@ -12,6 +12,12 @@ This error occured in file {{ file }} on line {{ line }} with code {{ code }}.

+{% if loggedIn %} +

+ The error was encountered by user #{{ user.id }}, {{ user.email }}. +

+{% endif %} +

The full stacktrace is below. If you think this is a bug in Firefly III, you can forward this message to diff --git a/resources/views/emails/error.twig b/resources/views/emails/error.twig index 03c60c67b8..28986f90a7 100644 --- a/resources/views/emails/error.twig +++ b/resources/views/emails/error.twig @@ -2,6 +2,10 @@ Firefly III ran into an error: {{ errorMessage }}. This error occured in file "{{ file }}" on line {{ line }} with code {{ code }}. +{% if loggedIn %} +The error was encountered by user #{{ user.id }}, {{ user.email }}. +{% endif %} + The full stacktrace is below. If you think this is a bug in Firefly III, you can forward this message to thegrumpydictator@gmail.com. This can help fix the bug you just encountered.