Skip to content

Commit

Permalink
remove gin handler
Browse files Browse the repository at this point in the history
  • Loading branch information
ardifirmansyah authored Jun 21, 2023
1 parent fa03e96 commit af723da
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions panics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit af723da

Please sign in to comment.