We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b08f39 commit 43ff451Copy full SHA for 43ff451
utils/error-monitoring.ts
@@ -0,0 +1,22 @@
1
+import * as Sentry from '@sentry/nextjs';
2
+
3
+export function initErrorMonitoring() {
4
+ if (process.env.NEXT_PUBLIC_SENTRY_DSN) {
5
+ Sentry.init({
6
+ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
7
+ tracesSampleRate: 1.0,
8
+ debug: process.env.NODE_ENV === 'development',
9
+ });
10
+ }
11
+}
12
13
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
14
+export function logError(error: Error, context?: Record<string, any>) {
15
+ console.error('Error:', error);
16
17
18
+ Sentry.captureException(error, {
19
+ extra: context,
20
21
22
0 commit comments