Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions bootstrap/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,13 @@
];

if (in_array($statusCode, [500, 503, 404, 403])) {
if (!$request->inertia()) {
if (
$statusCode === 500
&& app()->hasDebugModeEnabled()
&& get_class($exception) !== ErrorToastException::class
) {
return $response;
} elseif (!$request->inertia()) {
// Show error page component for standard visits
return Inertia::render('Error', [
'errorTitles' => $errorTitles,
Expand All @@ -62,10 +68,6 @@
->toResponse($request)
->setStatusCode($statusCode);
} else {
// Show standard modal for easier debugging locally
if (app()->hasDebugModeEnabled() && $statusCode === 500) {
return $response;
}
// Return JSON response for PrimeVue toast to display, handled by Inertia router event listener
$errorSummary = "$statusCode - $errorTitles[$statusCode]";
$errorDetail = $errorDetails[$statusCode];
Expand Down