How do you deal with errors and e.g. sentry? #1934
Answered
by
KATT
marc-on-github
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
KATT
May 25, 2022
Replies: 2 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
marc-on-github
-
|
One way I could think of would be to use a custom const t = initTRPC.context<CustomContext>().create({
errorFormatter: function({ shape, error }): any {
Sentry.captureException(error)
return shape
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

https://github.com/trpc/examples-next-prisma-starter/blob/5158b825a2c236e19ef1e7128f86021498fc833c/src/pages/api/trpc/%5Btrpc%5D.ts#L14-L22