mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 18:51:19 +00:00
Added the panic capture so that information about panic gets into the log file (#3877)
* Added the panic capture so that information about it gets into the log file * Printf -> Errorf * Update validator/main.go "run time" -> "Runtime" Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com> * Update beacon-chain/main.go "run time" -> "Runtime" Co-Authored-By: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
parent
295b3a74e9
commit
5a789fca4a
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
runtimeDebug "runtime/debug"
|
||||
|
||||
golog "github.com/ipfs/go-log"
|
||||
joonix "github.com/joonix/log"
|
||||
@ -123,6 +124,13 @@ func main() {
|
||||
return debug.Setup(ctx)
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if x := recover(); x != nil {
|
||||
log.Errorf("Runtime panic: %v\n%v", x, string(runtimeDebug.Stack()))
|
||||
panic(x)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
log.Error(err.Error())
|
||||
os.Exit(1)
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
runtimeDebug "runtime/debug"
|
||||
|
||||
joonix "github.com/joonix/log"
|
||||
"github.com/prysmaticlabs/prysm/shared/cmd"
|
||||
@ -152,6 +153,13 @@ contract in order to activate the validator client`,
|
||||
return nil
|
||||
}
|
||||
|
||||
defer func() {
|
||||
if x := recover(); x != nil {
|
||||
log.Errorf("Runtime panic: %v\n%v", x, string(runtimeDebug.Stack()))
|
||||
panic(x)
|
||||
}
|
||||
}()
|
||||
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
log.Error(err.Error())
|
||||
os.Exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user