Skip to content

Commit 663f3c4

Browse files
committed
Merge branch 'master' of github.com:connorabbas/laravel-primevue-starter-kit into admin-role-dev
2 parents 47a8278 + ca0b9e4 commit 663f3c4

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
@@ -52,7 +52,13 @@
5252
];
5353

5454
if (in_array($statusCode, [500, 503, 404, 403])) {
55-
if (!$request->inertia()) {
55+
if (
56+
$statusCode === 500
57+
&& app()->hasDebugModeEnabled()
58+
&& get_class($exception) !== ErrorToastException::class
59+
) {
60+
return $response;
61+
} elseif (!$request->inertia()) {
5662
// Show error page component for standard visits
5763
return Inertia::render('Error', [
5864
'errorTitles' => $errorTitles,
@@ -67,10 +73,6 @@
6773
->toResponse($request)
6874
->setStatusCode($statusCode);
6975
} else {
70-
// Show standard modal for easier debugging locally
71-
if (app()->hasDebugModeEnabled() && $statusCode === 500) {
72-
return $response;
73-
}
7476
// Return JSON response for PrimeVue toast to display, handled by Inertia router event listener
7577
$errorSummary = "$statusCode - $errorTitles[$statusCode]";
7678
$errorDetail = $errorDetails[$statusCode];

0 commit comments

Comments
 (0)