diff --git a/app/Exceptions/ErrorHandlingConfig.php b/app/Exceptions/ErrorHandlingConfig.php deleted file mode 100644 index 3cf39885..00000000 --- a/app/Exceptions/ErrorHandlingConfig.php +++ /dev/null @@ -1,19 +0,0 @@ -withExceptions(function (Exceptions $exceptions): void { $exceptions->respond(function (Response $response, Throwable $exception, Request $request): Response { - if (!app()->environment(["local", "testing"]) && in_array($response->getStatusCode(), ErrorHandlingConfig::HANDLED_ERROR_CODES, true)) { + if (!app()->environment(["local", "testing"]) && in_array($response->getStatusCode(), [ + Response::HTTP_FORBIDDEN, + Response::HTTP_INTERNAL_SERVER_ERROR, + Response::HTTP_SERVICE_UNAVAILABLE, + Response::HTTP_NOT_FOUND, + ], true)) { return Inertia::render("Errors/Error", ["status" => $response->getStatusCode()]) ->toResponse($request) ->setStatusCode($response->getStatusCode()); - } elseif ($response->getStatusCode() === ErrorHandlingConfig::HTTP_SESSION_EXPIRED) { + } elseif ($response->getStatusCode() === 419) { return back()->with([ "message" => "The page expired, please try again.", ]);