diff --git a/ginext/funcWrapper.go b/ginext/funcWrapper.go index 46fa1c2..59d2623 100644 --- a/ginext/funcWrapper.go +++ b/ginext/funcWrapper.go @@ -3,7 +3,6 @@ package ginext import ( "fmt" "net/http" - "strings" "git.blackforestbytes.com/BlackForestBytes/goext/exerr" "github.com/gin-gonic/gin" @@ -42,6 +41,8 @@ func Wrap(w *GinWrapper, fn WHandlerFunc) gin.HandlerFunc { } if g.Writer.Written() { + // (!) This panic is not preoperly cached - it will kill the whole process + // but that only means you should NOT write in WrapperFunc... panic("Writing in WrapperFunc is not supported") } @@ -64,7 +65,11 @@ func Wrap(w *GinWrapper, fn WHandlerFunc) gin.HandlerFunc { wrap.Write(g) if g.IsAborted() { // can happen if we try to marshal an invalid json object (e.g. containing Inf) - panic("Failed to write response to renderer:\n" + strings.Join(g.Errors.Errors(), "\n")) + exerr. + New(exerr.TypePanic, "Failed to write response to renderer"). + Strs("errors", g.Errors.Errors()). + Stack(). + Print(g) } } } diff --git a/goextVersion.go b/goextVersion.go index fee5eed..a8d750f 100644 --- a/goextVersion.go +++ b/goextVersion.go @@ -1,5 +1,5 @@ package goext -const GoextVersion = "0.0.619" +const GoextVersion = "0.0.620" -const GoextVersionTimestamp = "2026-01-08T22:58:50+0100" +const GoextVersionTimestamp = "2026-01-08T23:03:55+0100"