diff --git a/contribs/gnodev/main.go b/contribs/gnodev/main.go index 2a97038b2cd..6e6d12fcbdc 100644 --- a/contribs/gnodev/main.go +++ b/contribs/gnodev/main.go @@ -10,7 +10,6 @@ import ( "net/http" "os" "path/filepath" - "runtime/debug" "strings" "time" @@ -175,6 +174,8 @@ func execDev(cfg *devCfg, args []string, io commands.IO) (err error) { if err != nil { return fmt.Errorf("unable to init raw term: %w", err) } + defer restore() + // Setup trap signal osm.TrapSignal(func() { cancel(nil) @@ -185,15 +186,6 @@ func execDev(cfg *devCfg, args []string, io commands.IO) (err error) { loggerEvents := logger.WithGroup(EventServerLogName) emitterServer := emitter.NewServer(loggerEvents) - // Defer cleanup - cleanup := func() { - if r := recover(); r != nil { - logger.Error("something went wrong", "err", r, "stack", string(debug.Stack())) - } - restore() - } - defer cleanup() - // Setup Dev Node // XXX: find a good way to export or display node logs devNode, err := setupDevNode(ctx, logger, cfg, emitterServer, pkgpaths)