Skip to content

Commit

Permalink
remove redundant info stracktrace from extras and add context for new…
Browse files Browse the repository at this point in the history
…er sentry deployments
  • Loading branch information
deep110 committed Nov 25, 2021
1 parent 3fbdeee commit 0eb2b4a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions surveillance/sentry.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,12 @@ func (wrapper *Sentry) Capture(err error, _panic bool) {
sentry.WithScope(func(scope *sentry.Scope) {

// Setting the stacktrace of the error as an extra along with any other extras set in the error
if extras := errors.Extras(err); extras != nil{
if extras := errors.Extras(err); extras != nil {
scope.SetContext("extras", extras)

// setExtras is deprecated
// adding it for backward compatibility with vernacular's sentry
scope.SetExtras(extras)
scope.SetExtra("stacktrace", errors.Stacktrace(err))
} else {
scope.SetExtras(map[string]interface{}{
"stacktrace": errors.Stacktrace(err),
})
}

// Determining the tags(if any) set on the error
Expand Down Expand Up @@ -106,12 +105,11 @@ func (wrapper *Sentry) CaptureWithContext(c context.Context, err error, _panic b
sentry.WithScope(func(scope *sentry.Scope) {
// Setting the stacktrace of the error as an extra along with any other extras set in the error
if extras := errors.Extras(err); extras != nil {
scope.SetContext("extras", extras)

// setExtras is deprecated
// adding it for backward compatibility with vernacular's sentry
scope.SetExtras(extras)
scope.SetExtra("stacktrace", errors.Stacktrace(err))
} else {
scope.SetExtras(map[string]interface{}{
"stacktrace": errors.Stacktrace(err),
})
}

// Determining the tags(if any) set on the error
Expand Down

0 comments on commit 0eb2b4a

Please sign in to comment.