We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event
EventHint
Currently, the Hub does not expose a public method like:
Hub
hub.CaptureEventWithHint(event *Event, hint *EventHint) // or hub.CaptureEventWithOriginalError(event *Event, originalError error)
However, In SentryHandler.Handle, we wanna:
SentryHandler.Handle
EventHint.OriginalException
Without the above public method, we are now forced to call either:
hub.CaptureException(err)
hub.CaptureEvent(event)
BeforeSend
Introduce a new public method in Hub like this:
func (hub *Hub) CaptureEventWithHint(event *Event, hint *sentry.EventHint) *EventID { client, scope := hub.Client(), hub.Scope() if client == nil || scope == nil { return nil } // Capture the event with hint eventID := client.CaptureEvent(event, hint, scope) if eventID != nil { hub.mu.Lock() hub.lastEventID = *eventID hub.mu.Unlock() } return eventID } // or func (hub *Hub) CaptureEventWithOriginalError(event *Event, err error) *EventID { client, scope := hub.Client(), hub.Scope() if client == nil || scope == nil { return nil } // Create hint with original error var hint *sentry.EventHint if err != nil { hint = &sentry.EventHint{OriginalException: err} } // Capture the event with hint eventID := client.CaptureEvent(event, hint, scope) if eventID != nil { hub.mu.Lock() hub.lastEventID = *eventID hub.mu.Unlock() } return eventID }
The text was updated successfully, but these errors were encountered:
slog.Handler
No branches or pull requests
Problem Statement
Currently, the
Hub
does not expose a public method like:However, In
SentryHandler.Handle
, we wanna:EventHint.OriginalException
.Without the above public method, we are now forced to call either:
hub.CaptureException(err)
– Loses slog attributes.hub.CaptureEvent(event)
– Cannot attachEventHint.OriginalException
for theBeforeSend
callback func.Solution Brainstorm
Introduce a new public method in
Hub
like this:The text was updated successfully, but these errors were encountered: