Files
BrowserOS/apps/agent/lib/sentry/sentryRootErrorHandler.ts
Dani Akash 025780faea feat: agent code in monorepo (#137)
* feat: added agent code to monorepo

* chore: update bun lock file
2025-12-29 18:39:52 +05:30

19 lines
761 B
TypeScript

import type ReactDOM from 'react-dom/client'
import { sentry } from './sentry'
/**
* @public
*/
export const sentryRootErrorHandler: ReactDOM.RootOptions = {
// Callback called when an error is thrown and not caught by an ErrorBoundary.
onUncaughtError: sentry.reactErrorHandler((error, errorInfo) => {
// Error caught by sentry, log to console for debugging purposes
// biome-ignore lint/suspicious/noConsole: must log to console for debugging purposes
console.error(error, errorInfo.componentStack)
}),
// Callback called when React catches an error in an ErrorBoundary.
onCaughtError: sentry.reactErrorHandler(),
// Callback called when React automatically recovers from errors.
onRecoverableError: sentry.reactErrorHandler(),
}