mirror of https://github.com/jetkvm/kvm.git
Add a global panic handler to ensure we log panics
This commit is contained in:
parent
b6c1e49803
commit
96c005b58c
8
main.go
8
main.go
|
|
@ -15,6 +15,14 @@ var appCtx context.Context
|
|||
|
||||
func Main() {
|
||||
logger.Log().Msg("JetKVM Starting Up")
|
||||
|
||||
// add recover to ensure we log out any panic
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
logger.Panic().Interface("recovered", r).Msg("Uncaught panic")
|
||||
}
|
||||
}()
|
||||
|
||||
LoadConfig()
|
||||
|
||||
var cancel context.CancelFunc
|
||||
|
|
|
|||
Loading…
Reference in New Issue