Automatic Error Capture
Once the SDK is initialized, unhandled errors are automatically captured without any additional code.- JavaScript
- Python
The JavaScript SDK automatically captures:
- Uncaught exceptions via
window.onerror - Unhandled promise rejections via
window.onunhandledrejection
Manual Error Capture
For errors you catch and handle yourself, use the manual capture methods.Capturing Messages
Sometimes you want to report an issue that isn’t an exception. Use message capture for these cases.Available levels:
error, warning, infoEvent IDs
BothcaptureException() and captureMessage() return a unique event ID (UUID). This is useful for:
- Customer support: Include in error messages so users can reference specific issues
- Logging: Correlate your logs with Proliferate events
- Debugging: Quickly find specific errors in the dashboard
Extra Context
Add arbitrary data to individual error captures using theextra option:
Re-entrancy Protection
The JavaScript SDK includes built-in protection against infinite loops. If an error occurs while the SDK is already processing an error (e.g., a network failure while sending an error report), it will be silently ignored to prevent cascading failures.
Best Practices
Don't over-capture
Don't over-capture
Let automatic capture handle unhandled errors. Only manually capture errors you explicitly handle.
Add meaningful context
Add meaningful context
Include relevant business data (order IDs, user IDs, feature flags) that will help you debug.
Use appropriate levels
Use appropriate levels
Use
error for actual errors, warning for concerning but non-critical issues, and info for notable events.Save the event ID
Save the event ID
Store event IDs in your logs or show them to users for support reference.
Set user/account context
Set user/account context
Call
setUser() and setAccount() to automatically include user information with every error. See the Context documentation.
