From 9d0cb86677b51151a10f49c1fb866a5112c48c48 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Sat, 31 Aug 2024 17:48:28 -0700 Subject: [PATCH] Improve error messages --- apps/backend/src/route-handlers/smart-request.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/route-handlers/smart-request.tsx b/apps/backend/src/route-handlers/smart-request.tsx index 231e3bee4..48bebde67 100644 --- a/apps/backend/src/route-handlers/smart-request.tsx +++ b/apps/backend/src/route-handlers/smart-request.tsx @@ -227,14 +227,14 @@ async function parseAuth(req: NextRequest): Promise { break; } default: { - throw new StackAssertionError(`Unexpected request type: ${requestType}. We should've filtered this earlier`); + throw new StackAssertionError(`Unexpected request type: ${requestType}. This should never happen because we should've filtered this earlier`); } } } const project = await getProject(projectId); if (!project) { - throw new StackAssertionError("Project not found; this should never happen because having a project ID should guarantee a project", { projectId }); + throw new StackAssertionError("Project not found; this should never happen because passing the checks until here should guarantee that the project exists and that access to it is granted", { projectId }); } let user = null;