From f33e10d2c0d026ae2c592ee6e0d5a04957bbaa70 Mon Sep 17 00:00:00 2001 From: EwelinaLasowy Date: Mon, 28 Mar 2022 10:51:20 +0200 Subject: [PATCH] #93 - fix to error page --- app/Architecture/ExceptionHandler.php | 6 +-- resources/js/Pages/DefaultError.vue | 76 --------------------------- resources/js/Pages/Error.vue | 5 ++ 3 files changed, 7 insertions(+), 80 deletions(-) delete mode 100644 resources/js/Pages/DefaultError.vue diff --git a/app/Architecture/ExceptionHandler.php b/app/Architecture/ExceptionHandler.php index f05c4d2..6c17323 100644 --- a/app/Architecture/ExceptionHandler.php +++ b/app/Architecture/ExceptionHandler.php @@ -21,7 +21,7 @@ class ExceptionHandler extends Handler { $response = parent::render($request, $e); - if (!app()->environment(["local", "testing"]) && in_array($response->status(), [500, 503, 419, 404, 403], true)) { + if (!app()->environment(["local", "testing"]) && in_array($response->status(), [500, 503, 429, 419, 404, 403, 401], true)) { return Inertia::render("Error", [ "status" => $response->status(), ]) @@ -29,8 +29,6 @@ class ExceptionHandler extends Handler ->setStatusCode($response->status()); } - return Inertia::render("DefaultError") - ->toResponse($request) - ->setStatusCode($response->status()); + return $response; } } diff --git a/resources/js/Pages/DefaultError.vue b/resources/js/Pages/DefaultError.vue deleted file mode 100644 index a9c887f..0000000 --- a/resources/js/Pages/DefaultError.vue +++ /dev/null @@ -1,76 +0,0 @@ - - - \ No newline at end of file diff --git a/resources/js/Pages/Error.vue b/resources/js/Pages/Error.vue index 2e5721f..f01e30e 100644 --- a/resources/js/Pages/Error.vue +++ b/resources/js/Pages/Error.vue @@ -61,6 +61,11 @@ export default { title: 'Strona wygasła', message: 'Ta strona wygasła. Zaloguj się ponownie.', }, + 429: { + code: '429', + title: 'Przekroczono limit zapytań', + message: 'Wysłano ostatnio zbyt wiele zapytań. Poczekaj i spróbuj ponownie później.' + }, 500: { code: '500', title: 'Błąd serwera',