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
| Field | Description |
|---|---|
message | Error message |
stack | Stack trace |
type | Error type (TypeError, etc.) |
source | source, network, console, custom |
handled | Whether caught by try/catch |
filename | Source file |
lineno | Line number |
colno | Column 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
});