22 lines
567 B
TypeScript
22 lines
567 B
TypeScript
/**
|
|
* Companion endpoint to /sentry-example-page. Throws on every call
|
|
* so the "Throw server error" button has something real to fail
|
|
* against. The thrown error propagates to instrumentation.ts'
|
|
* onRequestError hook and lands in Sentry as a server-side issue.
|
|
*/
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
class SentryExampleApiError extends Error {
|
|
constructor(message: string) {
|
|
super(message);
|
|
this.name = "SentryExampleApiError";
|
|
}
|
|
}
|
|
|
|
export function GET() {
|
|
throw new SentryExampleApiError(
|
|
"Sentry test (API route) — vibn-ai",
|
|
);
|
|
}
|