mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-03 00:19:03 +02:00
🤖 Capture errors in sentry
This commit is contained in:
parent
88c86eae18
commit
fcf05b3dae
1 changed files with 6 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
import { createTRPCContext } from "@rallly/backend/trpc/context";
|
||||
import { AppRouter, appRouter } from "@rallly/backend/trpc/routers";
|
||||
import * as Sentry from "@sentry/nextjs";
|
||||
import * as trpcNext from "@trpc/server/adapters/next";
|
||||
|
||||
import { absoluteUrl, shortUrl } from "@/utils/absolute-url";
|
||||
|
@ -36,4 +37,9 @@ export default trpcNext.createNextApiHandler<AppRouter>({
|
|||
shortUrl,
|
||||
});
|
||||
},
|
||||
onError({ error }) {
|
||||
if (error.code === "INTERNAL_SERVER_ERROR") {
|
||||
Sentry.captureException(error);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue