Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print more error details in LogAndHandlePanic (#542)
Before this change, panics handled by `LogAndHandlePanic` were logged to the Quesma UI with only the stack trace - without any details about the error itself (for example without `runtime error: comparing uncomparable type []string`). This made debugging panics harder. This commit adds the error information from `commonRecovery` also to `LogAndHandlePanic`. Before: ``` quesma request failed: panic recovered goroutine 3436 [running]: runtime/debug.Stack() /Users/piotrgrabowski/sdk/go1.23rc1/src/runtime/debug/stack.go:26 +0x64 quesma/quesma/recovery.LogAndHandlePanic({0x1011f2510, 0x14004aaac90} ... ``` After: <pre> quesma request failed: Panic recovered: <b>runtime error: comparing uncomparable type []string</b> goroutine 3027 [running]: runtime/debug.Stack() /Users/piotrgrabowski/sdk/go1.23rc1/src/runtime/debug/stack.go:26 +0x64 quesma/quesma/recovery.LogAndHandlePanic({0x102b0a510, 0x14003944330} ... </pre> Co-authored-by: Jacek Migdal <[email protected]>
- Loading branch information