ensure that panics are written to the log file.
This commit is contained in:
parent
e2fa94545f
commit
27297f8eb6
|
@ -104,6 +104,13 @@ func main() {
|
|||
return err
|
||||
}
|
||||
|
||||
// ensure panics are written to the log file.
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
appLogger.Panic("panic occurred:", err)
|
||||
}
|
||||
}()
|
||||
|
||||
settingsData, err := json.Marshal(appconfig.AllSettings())
|
||||
appLogger.Debug(string(settingsData), err)
|
||||
|
||||
|
@ -171,6 +178,13 @@ func main() {
|
|||
return err
|
||||
}
|
||||
|
||||
// ensure panics are written to the log file.
|
||||
defer func() {
|
||||
if err := recover(); err != nil {
|
||||
appLogger.Panic("panic occurred:", err)
|
||||
}
|
||||
}()
|
||||
|
||||
_, err = database.NewRepository(appconfig, appLogger, event_bus.NewNoopEventBusServer())
|
||||
return err
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue