Skip to content

Commit e5b70ac

Browse files
feat: move to @sentry/node
1 parent 31d4690 commit e5b70ac

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

app/components/error-boundary.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
useParams,
77
useRouteError,
88
} from 'react-router'
9-
import { getErrorMessage } from '#app/utils/misc.tsx'
9+
import { getErrorMessage } from '#app/utils/misc'
1010

1111
type StatusHandler = (info: {
1212
error: ErrorResponse
@@ -27,7 +27,6 @@ export function GeneralErrorBoundary({
2727
unexpectedErrorHandler?: (error: unknown) => ReactElement | null
2828
}) {
2929
const error = useRouteError()
30-
3130
const params = useParams()
3231

3332
if (typeof document !== 'undefined') {
@@ -42,9 +41,9 @@ export function GeneralErrorBoundary({
4241
<div className="container flex items-center justify-center p-20 text-h2">
4342
{isRouteErrorResponse(error)
4443
? (statusHandlers?.[error.status] ?? defaultStatusHandler)({
45-
error,
46-
params,
47-
})
44+
error,
45+
params,
46+
})
4847
: unexpectedErrorHandler(error)}
4948
</div>
5049
)

app/entry.server.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,7 @@ export function handleError(
108108
}
109109
if (error instanceof Error) {
110110
console.error(chalk.red(error.stack))
111-
void Sentry.captureException(error, {
112-
level: 'fatal',
113-
})
111+
void Sentry.captureException(error)
114112
} else {
115113
console.error(error)
116114
Sentry.captureException(error)

server/utils/monitoring.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { prismaIntegration, httpIntegration } from '@sentry/node'
12
import { nodeProfilingIntegration } from '@sentry/profiling-node'
23
import * as Sentry from '@sentry/react'
34

@@ -17,11 +18,9 @@ export function init() {
1718
/\/site\.webmanifest/,
1819
],
1920
integrations: [
20-
// TODO: Figure out if this is still needed, and if so, how to make it work
21-
// Sentry.httpIntegration(),
22-
// Sentry.prismaIntegration(),
21+
prismaIntegration(),
22+
httpIntegration(),
2323
nodeProfilingIntegration(),
24-
// https://docs.sentry.io/platforms/javascript/guides/react/features/react-router/v7/
2524
],
2625
tracesSampler(samplingContext) {
2726
// ignore healthcheck transactions by other services (consul, etc.)

0 commit comments

Comments
 (0)