From 489f1fc079d69a6a061f9b2fd3c7f584ab83381d Mon Sep 17 00:00:00 2001 From: Nico Haas Date: Tue, 17 Jan 2023 08:56:10 +0100 Subject: [PATCH] Add error catch --- src/routes/cloud/[...id]/assessment/+page.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/routes/cloud/[...id]/assessment/+page.ts b/src/routes/cloud/[...id]/assessment/+page.ts index de733e4..28d2fa3 100644 --- a/src/routes/cloud/[...id]/assessment/+page.ts +++ b/src/routes/cloud/[...id]/assessment/+page.ts @@ -9,8 +9,15 @@ export async function load({ fetch, params }: LoadEvent) { results: results, }; }) - .catch(() => { - redirectLogin(`/cloud/${params.id}/assessment`); + .catch((error) => { + console.log("DEBUG:", error.message) + if (error.message == "Not Found") { + // TODO(lebogg): View some hinting message + console.log("In If") + } else { + console.log("In Else") + // redirectLogin(`/cloud/${params.id}/assessment`); + } }); }