Updates to budgets.

This commit is contained in:
James Cole
2016-04-28 10:59:36 +02:00
parent 19d7e27fa9
commit b47a140c2f
20 changed files with 510 additions and 182 deletions

View File

@@ -6,7 +6,6 @@ use Auth;
use ErrorException;
use Exception;
use FireflyIII\Jobs\MailError;
use FireflyIII\User;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
@@ -66,9 +65,14 @@ class Handler extends ExceptionHandler
{
if ($exception instanceof FireflyException || $exception instanceof ErrorException) {
$user = Auth::check() ? Auth::user() : new User;
$userData = [
'id' => 0,
'email' => 'unknown@example.com',
];
if (Auth::check()) {
$userData['id'] = Auth::user()->id;
$userData['email'] = Auth::user()->email;
}
$data = [
'class' => get_class($exception),
'errorMessage' => $exception->getMessage(),
@@ -80,7 +84,7 @@ class Handler extends ExceptionHandler
];
// create job that will mail.
$job = new MailError($user, env('SITE_OWNER'), Request::ip(), $data);
$job = new MailError($userData, env('SITE_OWNER'), Request::ip(), $data);
dispatch($job);
}