Skip to main content

Error Tracking

Automatically capture and track JavaScript errors.

Automatic Error Capture

RUM automatically captures:

  • Uncaught exceptions
  • Unhandled promise rejections
  • Console errors
  • Network failures
SimplrRUM.init({
apiKey: 'pk_live_xxx',
applicationId: 'my-app',
trackErrors: true // Enabled by default
});

Manual Error Tracking

Track errors manually:

try {
await riskyOperation();
} catch (error) {
SimplrRUM.trackError(error, {
operation: 'checkout',
cart_id: 'cart_123'
});
}

React Error Boundary

Wrap components to catch React errors:

import { RUMErrorBoundary } from '@simplr-ai/js/react';

function App() {
return (
<RUMErrorBoundary fallback={<ErrorPage />}>
<MainContent />
</RUMErrorBoundary>
);
}

useTrackError Hook

import { useTrackError } from '@simplr-ai/js/react';

function PaymentForm() {
const trackError = useTrackError();

const handlePayment = async () => {
try {
await processPayment();
} catch (error) {
trackError(error, { step: 'payment' });
showErrorMessage();
}
};

return <form onSubmit={handlePayment}>...</form>;
}

Error Data Captured

FieldDescription
messageError message
stackStack trace
typeError type (TypeError, etc.)
sourcesource, network, console, custom
handledWhether caught by try/catch
filenameSource file
linenoLine number
colnoColumn number

Error Deduplication

Identical errors are grouped to reduce noise:

  • Same message + stack → counted, not duplicated
  • Unique errors get full details
  • Dashboard shows error frequency

Privacy: Scrubbing PII

Enable PII scrubbing to remove sensitive data:

SimplrRUM.init({
scrubPII: true // Removes emails, names, etc. from error messages
});