What is collected automatically
OnceatatusRum.init() has run, the agent reports:
- Uncaught exceptions that reach
window.onerror. - Unhandled promise rejections.
- Failed network requests, when you set
trackResources. - Console errors, when you forward them through Logs.
Report an error yourself
When you catch an error and handle it, the agent never sees it. Report it withaddError, and pass any context that will help you triage:
Error object, by wrapping it:
Pass an
Error object rather than a string wherever you can. The agent reads the stack trace from the error, and a string has none.Catch React render errors
React catches errors thrown during rendering and unmounts the tree, so they never reachwindow.onerror and the agent cannot see them. Use the error boundary from the React package:
Record a replay when an error happens
Recording every session is expensive, and most sessions are uneventful. Record only the ones that break by starting replay from your error handler:Add context to every error
Anything you set as global context is attached to every event, including errors. This is useful for details that are true for the whole session:Next steps
- Session Replay: watch the session an error happened in.
- Logs: forward console errors alongside RUM errors.
- API Reference: the full method list.