From af723daed0e26b2afb335759a69b261cb60aaae4 Mon Sep 17 00:00:00 2001 From: M Ardi Firmansyah Date: Wed, 21 Jun 2023 13:20:12 +0700 Subject: [PATCH] remove gin handler --- panics.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/panics.go b/panics.go index b35c6f0..83099aa 100644 --- a/panics.go +++ b/panics.go @@ -18,7 +18,6 @@ import ( "time" "github.com/eapache/go-resiliency/breaker" - "github.com/gin-gonic/gin" "github.com/julienschmidt/httprouter" "github.com/nsqio/go-nsq" "google.golang.org/grpc" @@ -128,24 +127,6 @@ func CaptureNegroniHandler(w http.ResponseWriter, r *http.Request, next http.Han next(w, r) } -// CaptureGinHandler handle panic on gin handler. -func CaptureGinHandler() gin.HandlerFunc { - return func(c *gin.Context) { - request, _ := httputil.DumpRequest(c.Request, true) - defer func() { - if !recoveryBreak() { - r := panicRecover(recover()) - if r != nil { - publishError(r, request, true) - http.Error(c.Writer, r.Error(), http.StatusInternalServerError) - } - } - }() - - c.Next() - } -} - // Capture will publish any errors func Capture(err string, message ...string) { var tmp string