From a0b65ea8f4e6a87c2f7505f3684ab0ca8957e203de091f036973a8c516251b6f Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Fri, 27 Sep 2024 17:54:31 +0200 Subject: [PATCH] common: print stacktrace when recovering from panic --- bots-common/listen.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bots-common/listen.go b/bots-common/listen.go index 58afe74..88b6568 100644 --- a/bots-common/listen.go +++ b/bots-common/listen.go @@ -23,6 +23,7 @@ import ( "fmt" "log" "net/url" + "runtime/debug" "slices" "strings" "time" @@ -176,6 +177,7 @@ func ProcessEvent(f RequestProcessor, request *Request) { defer func() { if r := recover(); r != nil { log.Println(r) + log.Println(string(debug.Stack())) } }()