Only capture errors not already handled by echo

This commit is contained in:
kolaente 2020-06-19 18:43:10 +02:00
parent b8e281c50c
commit 562055763a
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 5 additions and 1 deletions

View File

@ -130,7 +130,11 @@ func NewEcho() *echo.Echo {
defer sentry.Flush(5 * time.Second)
e.HTTPErrorHandler = func(err error, c echo.Context) {
sentry.CaptureException(err)
// Only capture errors not already handled by echo
if _, ok := err.(*echo.HTTPError); !ok {
sentry.CaptureException(err)
log.Debugf("Error '%s' send to sentry", err.Error())
}
e.DefaultHTTPErrorHandler(err, c)
}