This commit is contained in:
2023-07-18 15:59:12 +02:00
parent d78550672e
commit 8d0ef0f002
6 changed files with 17 additions and 20 deletions

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"
"gogs.mikescher.com/BlackForestBytes/goext/ginext/commonapierr"
)
type WHandlerFunc func(PreContext) HTTPResponse
@@ -25,7 +24,7 @@ func Wrap(w *GinWrapper, fn WHandlerFunc) gin.HandlerFunc {
Interface("panicObj", panicObj).
Str("trace", stackTrace).
Msg("Panic occured (in gin handler)")
wrap = APIError(g, commonapierr.Panic, "A panic occured in the HTTP handler", errors.New(fmt.Sprintf("%+v", panicObj)))
wrap = APIError(g, commonApiErr.Panic, "A panic occured in the HTTP handler", errors.New(fmt.Sprintf("%+v", panicObj)))
}
if g.Writer.Written() {