Skip to content

Commit 4e11094

Browse files
committed
Merge branch 'master' of github.com:connorabbas/laravel-primevue-starter-kit into feature/docker-overhaull
2 parents b26e87b + ca0b9e4 commit 4e11094

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

bootstrap/app.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@
5555
];
5656

5757
if (in_array($statusCode, [500, 503, 404, 403])) {
58-
if (!$request->inertia()) {
58+
if (
59+
$statusCode === 500
60+
&& app()->hasDebugModeEnabled()
61+
&& get_class($exception) !== ErrorToastException::class
62+
) {
63+
return $response;
64+
} elseif (!$request->inertia()) {
5965
// Show error page component for standard visits
6066
return Inertia::render('Error', [
6167
'errorTitles' => $errorTitles,
@@ -70,10 +76,6 @@
7076
->toResponse($request)
7177
->setStatusCode($statusCode);
7278
} else {
73-
// Show standard modal for easier debugging locally
74-
if (app()->hasDebugModeEnabled() && $statusCode === 500) {
75-
return $response;
76-
}
7779
// Return JSON response for PrimeVue toast to display, handled by Inertia router event listener
7880
$errorSummary = "$statusCode - $errorTitles[$statusCode]";
7981
$errorDetail = $errorDetails[$statusCode];

0 commit comments

Comments
 (0)