⬆️ Upgrade sentry and improve its reliability

This commit is contained in:
Baptiste Arnaud
2023-10-07 12:03:42 +02:00
parent 15823df6bd
commit 3e7b9b3afd
23 changed files with 1931 additions and 1726 deletions

View File

@@ -1,6 +1,6 @@
import { createContext } from '@/helpers/server/context'
import { trpcRouter } from '@/helpers/server/routers/v1/trpcRouter'
import { captureException } from '@sentry/nextjs'
import * as Sentry from '@sentry/nextjs'
import { NextApiRequest, NextApiResponse } from 'next'
import { createOpenApiNextHandler } from 'trpc-openapi'
import cors from 'nextjs-cors'
@@ -15,7 +15,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
createContext,
onError({ error }) {
if (error.code === 'INTERNAL_SERVER_ERROR') {
captureException(error)
Sentry.captureException(error)
console.error('Something went wrong', error)
}
},