fix: do not push nil errors to sentry
This commit is contained in:
parent
e9de7d8a24
commit
1460d212ee
@ -156,10 +156,18 @@ func setupSentry(e *echo.Echo) {
|
|||||||
if hub != nil {
|
if hub != nil {
|
||||||
hub.WithScope(func(scope *sentry.Scope) {
|
hub.WithScope(func(scope *sentry.Scope) {
|
||||||
scope.SetExtra("url", c.Request().URL)
|
scope.SetExtra("url", c.Request().URL)
|
||||||
|
if herr.Internal == nil {
|
||||||
|
hub.CaptureException(err)
|
||||||
|
} else {
|
||||||
hub.CaptureException(herr.Internal)
|
hub.CaptureException(herr.Internal)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
if herr.Internal == nil {
|
||||||
|
sentry.CaptureException(err)
|
||||||
} else {
|
} else {
|
||||||
sentry.CaptureException(herr.Internal)
|
sentry.CaptureException(herr.Internal)
|
||||||
|
}
|
||||||
log.Debugf("Could not add context for sending error '%s' to sentry", err.Error())
|
log.Debugf("Could not add context for sending error '%s' to sentry", err.Error())
|
||||||
}
|
}
|
||||||
log.Debugf("Error '%s' sent to sentry", err.Error())
|
log.Debugf("Error '%s' sent to sentry", err.Error())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user