diff options
-rw-r--r-- | src/routes/loggedin/+server.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/routes/loggedin/+server.ts b/src/routes/loggedin/+server.ts index 4772cf6..e493f10 100644 --- a/src/routes/loggedin/+server.ts +++ b/src/routes/loggedin/+server.ts @@ -1,5 +1,5 @@ import { fetchApi } from '$lib/api' -import { redirect, type RequestHandler, } from '@sveltejs/kit' +import { error, redirect, type RequestHandler, } from '@sveltejs/kit' export const GET = (async ({ url, cookies }) => { const code = url.searchParams.get('code') @@ -15,7 +15,7 @@ export const GET = (async ({ url, cookies }) => { }), }).then(res => { if (res.status !== 200) - throw new Error(res.statusText) + throw error(500, `Non-200 response from API: ${res.status} ${res.text}`) return res.json() }) |