Capturing Exceptions
UsecaptureException() to manually send exceptions to Sentry:
With Additional Context
Add extra context when capturing exceptions:The
captureException method returns an event ID that you can use to reference the error later.Capturing Messages
For non-error events, usecaptureMessage() to send messages to Sentry:
Severity Levels
Messages support different severity levels:Capturing Custom Events
For full control, capture custom events withcaptureEvent():
Event IDs
All capture methods return an event ID:Checking SDK Status
Verify that Sentry is properly initialized:Flushing Events
Manually flush pending events:Error Filtering
Filter errors before they’re sent using thebeforeSend callback:
Next Steps
Scopes
Learn how to use scopes to add context to events
Context
Add rich contextual data to your error reports
Breadcrumbs
Track user actions leading up to errors
Event Processors
Process and modify events before they’re sent