Skip to content

Commit

Permalink
save (#3904)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Apr 17, 2022
1 parent d139c75 commit 7b057c0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cmd/erigon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"os"

"github.com/ledgerwatch/erigon/common/debug"
"github.com/ledgerwatch/erigon-lib/common/dbg"
"github.com/ledgerwatch/erigon/params"
erigoncli "github.com/ledgerwatch/erigon/turbo/cli"
"github.com/ledgerwatch/erigon/turbo/node"
Expand All @@ -13,7 +13,16 @@ import (
)

func main() {
defer debug.LogPanic()
defer func() {
panicResult := recover()
if panicResult == nil {
return
}

log.Error("catch panic", "err", panicResult, "stack", dbg.Stack())
os.Exit(1)
}()

app := erigoncli.MakeApp(runErigon, erigoncli.DefaultFlags)
if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down

0 comments on commit 7b057c0

Please sign in to comment.