From 644fbe5fa5e828564b615aacddbf3507a6504f70 Mon Sep 17 00:00:00 2001 From: Dan Jones Date: Wed, 7 Feb 2024 08:41:54 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Abort=20after=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://codeberg.org/danjones000/gin-error-handler/issues/1 --- handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/handler.go b/handler.go index f7da46f..151e139 100644 --- a/handler.go +++ b/handler.go @@ -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) } }