Only capture errors not already handled by echo
This commit is contained in:
parent
b8e281c50c
commit
562055763a
|
@ -130,7 +130,11 @@ func NewEcho() *echo.Echo {
|
||||||
defer sentry.Flush(5 * time.Second)
|
defer sentry.Flush(5 * time.Second)
|
||||||
|
|
||||||
e.HTTPErrorHandler = func(err error, c echo.Context) {
|
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)
|
e.DefaultHTTPErrorHandler(err, c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user