properly log unhandled panics.

This commit is contained in:
Miroslav Šedivý 2022-12-15 22:15:50 +01:00
parent 6b39e8e0e8
commit b49f545094

View File

@ -20,6 +20,14 @@ import (
)
func Execute() error {
// properly log unhandled panics
defer func() {
panicVal := recover()
if panicVal != nil {
log.Panic().Msgf("%v", panicVal)
}
}()
return root.Execute()
}