aboutsummaryrefslogtreecommitdiffstats
path: root/apps/kit
diff options
context:
space:
mode:
Diffstat (limited to 'apps/kit')
-rw-r--r--apps/kit/src/routes/(main)/+layout.server.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/kit/src/routes/(main)/+layout.server.ts b/apps/kit/src/routes/(main)/+layout.server.ts
index 32b0583..9836547 100644
--- a/apps/kit/src/routes/(main)/+layout.server.ts
+++ b/apps/kit/src/routes/(main)/+layout.server.ts
@@ -1,5 +1,6 @@
import { api_base, CookieNames } from "$lib/configuration";
-import { redirect } from "@sveltejs/kit";
+import { logError } from "$lib/logger";
+import { error, redirect } from "@sveltejs/kit";
import type { LayoutServerLoad } from "./$types";
export const load: LayoutServerLoad = async ({ routeId, cookies }) => {
@@ -9,7 +10,12 @@ export const load: LayoutServerLoad = async ({ routeId, cookies }) => {
headers: {
Cookie: CookieNames.session + "=" + sessionCookie,
}
- })).ok
+ }).catch((e) => {
+ logError(e);
+ throw error(503, {
+ message: "We are experiencing a service distruption! Have patience while we resolve the issue."
+ })
+ })).ok;
if (sessionIsValid && isPublicRoute) {
throw redirect(302, "/home");