Skip to content

Commit

Permalink
chore: remove useless recover
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <8671905+gfanton@users.noreply.github.com>
  • Loading branch information
gfanton committed Apr 10, 2024
1 parent b24ec1e commit 4a6baa4
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions contribs/gnodev/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"net/http"
"os"
"path/filepath"
"runtime/debug"
"strings"
"time"

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 4a6baa4

Please sign in to comment.