Capture error when calling old dashboard API

This commit is contained in:
Konstantin Wohlwend 2024-08-30 14:05:31 -07:00
parent 853d369dcb
commit 886553b82b

View File

@ -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,
});