📈 (analytics) Add Sentry for error tracker
This commit is contained in:
14
app/api/sentry-example-api/route.ts
Normal file
14
app/api/sentry-example-api/route.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
class SentryExampleAPIError extends Error {
|
||||
constructor(message: string | undefined) {
|
||||
super(message);
|
||||
this.name = "SentryExampleAPIError";
|
||||
}
|
||||
}
|
||||
// A faulty API route to test Sentry's error monitoring
|
||||
export function GET() {
|
||||
throw new SentryExampleAPIError("This error is raised on the backend called by the example page.");
|
||||
return NextResponse.json({ data: "Testing Sentry Error..." });
|
||||
}
|
||||
Reference in New Issue
Block a user