fix: do not push nil errors to sentry
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2024-04-13 21:46:07 +02:00
parent e9de7d8a24
commit 1460d212ee
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 10 additions and 2 deletions

View File

@ -156,10 +156,18 @@ func setupSentry(e *echo.Echo) {
if hub != nil {
hub.WithScope(func(scope *sentry.Scope) {
scope.SetExtra("url", c.Request().URL)
hub.CaptureException(herr.Internal)
if herr.Internal == nil {
hub.CaptureException(err)
} else {
hub.CaptureException(herr.Internal)
}
})
} else {
sentry.CaptureException(herr.Internal)
if herr.Internal == nil {
sentry.CaptureException(err)
} else {
sentry.CaptureException(herr.Internal)
}
log.Debugf("Could not add context for sending error '%s' to sentry", err.Error())
}
log.Debugf("Error '%s' sent to sentry", err.Error())