X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/82a8db373961d89ab1c9a3736ba5fc467fe2e03d..refs/pull/2393/head:/app/Exceptions/Handler.php diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 284d731d7..57078522b 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -9,7 +9,6 @@ use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; -use Illuminate\Http\Response; use Illuminate\Validation\ValidationException; use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -26,6 +25,7 @@ class Handler extends ExceptionHandler HttpException::class, ModelNotFoundException::class, ValidationException::class, + NotFoundException::class, ]; /** @@ -57,7 +57,10 @@ class Handler extends ExceptionHandler // Handle notify exceptions which will redirect to the // specified location then show a notification message. if ($this->isExceptionType($e, NotifyException::class)) { - session()->flash('error', $this->getOriginalMessage($e)); + $message = $this->getOriginalMessage($e); + if (!empty($message)) { + session()->flash('error', $message); + } return redirect($e->redirectLocation); }