diff --git a/bootstrap/app.php b/bootstrap/app.php index 912fa3f..52413c5 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -49,7 +49,15 @@ return Application::configure(basePath: dirname(__DIR__)) // it too (R16); returning null falls through to the normal renderer (the // resources/views/errors/* views). $exceptions->render(function (Throwable $e, Request $request) { - SetLocale::apply($request); + // Best-effort: locale resolution touches the session/user, which can be the + // very thing that failed (e.g. a DB outage). Swallow any error so this hook + // can never throw a second exception and break the custom error page — the + // page just renders in the default locale instead. + try { + SetLocale::apply($request); + } catch (Throwable) { + // keep the default locale + } return null; });