From c0097d2d215de5a6fbb3b34572bff7c1d926b0f1 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Tue, 30 Apr 2024 20:21:53 -0500 Subject: [PATCH] chore: Add formatted log when recovering from a panic --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index a6563cc3..48275945 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,7 @@ func main() { var status int if msg := recover(); msg != nil { status = 1 + log.Error().Interface("error", msg).Msg("recovered from panic") err = fmt.Errorf("%w: %v\n\n%s", errPanic, msg, string(debug.Stack())) _, _ = io.WriteString(os.Stderr, err.Error()) }