Skip to content

Frontend error tracking in Osuite

The SDK listens on every uncaught error source by default:

  • window.error for runtime errors.
  • unhandledrejection for unhandled Promise rejections.
  • window.error for failed <img> / <script> / <link> / <audio> / <video> / <source> loads.
  • The optional OsuiteErrorBoundary for React render crashes.

Every error is emitted as a log record with a full stack trace, the browser/route/user context at the time, and a stable event.name (browser.error, browser.unhandled_rejection, browser.resource_error, browser.react_error). Errors group on stack-trace fingerprint, so you can see frequency, browsers affected, and trend direction. From an error group, you can jump to the matching session replay or to the backend trace the request produced.

Which of these sources are active is controlled by the errors configuration.

Report handled errors and messages with the public API:

import { osuite } from '@osuite/rum';
osuite.captureException(err, {
extra: { feature: 'checkout', cartTotal: 42.5 },
level: 'error',
});
osuite.captureMessage('payment retried', 'warn', {
extra: { attempt: 2 },
});

extra keys become app.<key> log attributes. Levels are 'debug' | 'info' | 'warn' | 'error' | 'fatal'; 'fatal' triggers a sampling upgrade so the buffered context around the failure exports. The full public API is in the SDK reference.

The React subpath adds an error boundary that catches render crashes. It lives on @osuite/rum/react so the baseline bundle never pulls React in:

import { OsuiteErrorBoundary } from '@osuite/rum/react';
export default function Root() {
return (
<OsuiteErrorBoundary
fallback={<ErrorPage />}
onError={(err, info) => {/* optional side-effect */}}
>
<App />
</OsuiteErrorBoundary>
);
}

Render errors get event.name='browser.react_error' and a react.component_stack attribute. The boundary also triggers a sampling upgrade so the buffered context around the crash exports.

  • Session replay — watch the recording of the session that hit an error
  • Sampling — how error-triggered upgrade keeps broken sessions
  • SDK reference — the errors configuration and full public API