Barazo default frontend
barazo.forum
1/**
2 * Error reporting utility.
3 * Logs errors with structured context. When GlitchTip/@sentry/nextjs is
4 * installed, add `import * as Sentry from '@sentry/nextjs'` and call
5 * `Sentry.captureException(error, { tags: context })` here.
6 */
7
8interface ErrorContext {
9 /** Which boundary caught the error (e.g. 'root', 'admin', 'thread') */
10 boundary: string
11 /** Additional metadata */
12 [key: string]: string
13}
14
15export function reportError(error: Error, context: ErrorContext): void {
16 console.error('[Barazo]', context.boundary, error.message, context)
17
18 // TODO: Add GlitchTip/Sentry integration when @sentry/nextjs is installed.
19 // See .env.example NEXT_PUBLIC_SENTRY_DSN.
20}