From e3f133a23dd60e553f6d763fb5935307162274eb Mon Sep 17 00:00:00 2001 From: Martin Angers Date: Tue, 1 Oct 2019 13:22:06 -0400 Subject: [PATCH] get stack before call --- builder/middleware.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builder/middleware.go b/builder/middleware.go index 84ac1da..60b352f 100644 --- a/builder/middleware.go +++ b/builder/middleware.go @@ -183,7 +183,8 @@ func panicRecovery(recoverFn func(http.ResponseWriter, *http.Request, interface{ return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { defer func() { if err := recover(); err != nil { - recoverFn(w, r, err, debug.Stack()) + stack := debug.Stack() + recoverFn(w, r, err, stack) } }() h.ServeHTTP(w, r) -- 2.45.2