Add sentry panic handler
This commit is contained in:
parent
6d1dd80d8c
commit
b8e281c50c
|
@ -133,6 +133,15 @@ func NewEcho() *echo.Echo {
|
|||
sentry.CaptureException(err)
|
||||
e.DefaultHTTPErrorHandler(err, c)
|
||||
}
|
||||
|
||||
// Maybe we don't need a middleware since echo recovers the error and bubbles it up to the error handler where
|
||||
// sentry catches it?
|
||||
e.Use(func(next echo.HandlerFunc) echo.HandlerFunc {
|
||||
return func(c echo.Context) error {
|
||||
defer sentry.Recover()
|
||||
return next(c)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Validation
|
||||
|
|
Loading…
Reference in New Issue