From 886553b82baa04f8841c03ca68f9dbcac4991292 Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Fri, 30 Aug 2024 14:05:31 -0700 Subject: [PATCH] Capture error when calling old dashboard API --- apps/dashboard/src/app/api/[...any]/route.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/app/api/[...any]/route.tsx b/apps/dashboard/src/app/api/[...any]/route.tsx index e9a72c826..f2ca74573 100644 --- a/apps/dashboard/src/app/api/[...any]/route.tsx +++ b/apps/dashboard/src/app/api/[...any]/route.tsx @@ -1,8 +1,11 @@ +import { StackAssertionError, captureError } from "@stackframe/stack-shared/dist/utils/errors"; import { NextRequest, NextResponse } from "next/server"; const handler = async (req: NextRequest) => { + const msg = "Stack Auth's dashboard API is no longer available. Please upgrade the version of your Stack Auth client library, or join our Discord server for assistance: https://discord.stack-auth.com"; + captureError("old-dashboard-api", new StackAssertionError(msg, { req })); return NextResponse.json({ - error: "Stack Auth's dashboard API is no longer available. Please upgrade the version of your Stack Auth client library, or join our Discord server for assistance: https://discord.stack-auth.com", + error: msg, }, { status: 400, });