Upgrade Sentry

This commit is contained in:
Konstantin Wohlwend 2024-11-22 19:06:34 +01:00
parent 5ffdfd067f
commit 32e32d502a
7 changed files with 841 additions and 227 deletions

View File

@ -43,7 +43,7 @@
"@opentelemetry/semantic-conventions": "^1.27.0",
"@prisma/client": "^5.9.1",
"@prisma/instrumentation": "^5.19.1",
"@sentry/nextjs": "^7.105.0",
"@sentry/nextjs": "^8.40.0",
"@simplewebauthn/server": "^11.0.0",
"@stackframe/stack-emails": "workspace:*",
"@stackframe/stack-shared": "workspace:*",

View File

@ -0,0 +1,14 @@
import { createSmartRouteHandler } from "@/route-handlers/smart-route-handler";
import { yupNumber, yupObject, yupString } from "@stackframe/stack-shared/dist/schema-fields";
import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors";
export const GET = createSmartRouteHandler({
request: yupObject({}),
response: yupObject({
statusCode: yupNumber().oneOf([200]).defined(),
bodyType: yupString().oneOf(["success"]).defined(),
}),
handler: async (req) => {
throw new StackAssertionError(`Server debug error thrown successfully! ${Math.random()}`);
},
});

View File

@ -0,0 +1,14 @@
"use client";
import { throwErr } from "@stackframe/stack-shared/dist/utils/errors";
export default function Page() {
return <div>
This page is useful for testing error handling.<br />
Your observability platform should pick up on the errors thrown below.<br />
<button onClick={() => throwErr(`Client debug error thrown successfully! ${Math.random()}`)}>Throw client error</button>
<button onClick={() => {
console.log("Endpoint request", fetch("/health/error-handler-debug/endpoint"));
}}>Throw server error</button>
</div>;
}

View File

@ -23,7 +23,7 @@
"@next/mdx": "^14",
"@node-oauth/oauth2-server": "^5.1.0",
"@radix-ui/react-icons": "^1.3.1",
"@sentry/nextjs": "^7.105.0",
"@sentry/nextjs": "^8.40.0",
"@stackframe/stack": "workspace:*",
"@stackframe/stack-emails": "workspace:*",
"@stackframe/stack-shared": "workspace:*",

View File

@ -0,0 +1,5 @@
import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors";
export function GET() {
throw new StackAssertionError(`Server debug error thrown successfully! ${Math.random()}`);
}

View File

@ -0,0 +1,15 @@
"use client";
import { throwErr } from "@stackframe/stack-shared/dist/utils/errors";
import { Button } from "@stackframe/stack-ui";
export default function Page() {
return <div>
This page is useful for testing error handling.<br />
Your observability platform should pick up on the errors thrown below.<br />
<Button onClick={() => throwErr(`Client debug error thrown successfully! ${Math.random()}`)}>Throw client error</Button>
<Button onClick={async () => {
console.log("Endpoint response", await fetch("/health/error-handler-debug/endpoint"));
}}>Throw server error</Button>
</div>;
}

File diff suppressed because it is too large Load Diff