mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Expand exception code and fix demo user redirect.
This commit is contained in:
@@ -22,9 +22,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Exceptions;
|
||||
|
||||
use Exception;
|
||||
/**
|
||||
* Class FireflyException.
|
||||
*/
|
||||
class FireflyException extends \Exception
|
||||
class FireflyException extends Exception
|
||||
{
|
||||
}
|
||||
|
@@ -70,14 +70,15 @@ class Handler extends ExceptionHandler
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
if ($exception instanceof NotFoundHttpException && $request->expectsJson()) {
|
||||
// JSON error:
|
||||
return response()->json(['message' => 'Resource not found', 'exception' => 'NotFoundHttpException'], 404);
|
||||
}
|
||||
|
||||
if ($exception instanceof AuthenticationException && $request->expectsJson()) {
|
||||
// somehow Laravel handler does not catch this:
|
||||
return response()->json(['message' => 'Unauthenticated', 'exception' => 'AuthenticationException'], 401);
|
||||
}
|
||||
|
||||
|
||||
if ($request->expectsJson()) {
|
||||
$isDebug = config('app.debug', false);
|
||||
if ($isDebug) {
|
||||
|
Reference in New Issue
Block a user