🐛 Abort after error

Fixes https://codeberg.org/danjones000/gin-error-handler/issues/1
This commit is contained in:
Dan Jones 2024-02-07 08:41:54 -06:00
commit 644fbe5fa5

View file

@ -25,6 +25,8 @@ func HandlerWithErrorWrapper(h HandlerWithError) gin.HandlerFunc {
return func(c *gin.Context) {
err := h(c)
if err != nil {
// We shouldn't process more handlers if there was an error
c.Abort()
c.Error(err)
}
}