diff --git a/apps/scandic-web/lib/trpc/server.ts b/apps/scandic-web/lib/trpc/server.ts index 5d8539a8a..70a417749 100644 --- a/apps/scandic-web/lib/trpc/server.ts +++ b/apps/scandic-web/lib/trpc/server.ts @@ -1,3 +1,4 @@ +import * as Sentry from "@sentry/nextjs" import { TRPCError } from "@trpc/server" import { redirect } from "next/navigation" @@ -49,6 +50,19 @@ export function serverClient() { redirect(redirectUrl) } } + + Sentry.captureException(error, { + extra: { + input, + path, + type, + url: ctx?.url, + lang: ctx?.lang, + pathname: ctx?.pathname, + contentType: ctx?.contentType, + uid: ctx?.uid, + }, + }) }, }) } diff --git a/apps/scandic-web/server/trpc.ts b/apps/scandic-web/server/trpc.ts index 44a30fda9..f33e06f1f 100644 --- a/apps/scandic-web/server/trpc.ts +++ b/apps/scandic-web/server/trpc.ts @@ -1,4 +1,4 @@ -import * as Sentry from "@sentry/node" +import * as Sentry from "@sentry/nextjs" import { initTRPC } from "@trpc/server" import { experimental_nextAppDirCaller } from "@trpc/server/adapters/next-app-dir" import { ZodError } from "zod"