Skip to content

Commit

Permalink
Merge pull request #166 from Cerebellum-Network/feature/fix-logs
Browse files Browse the repository at this point in the history
Handle error before proceeding farther
  • Loading branch information
MRamanenkau authored Jan 16, 2024
2 parents c3f4b09 + f3378b4 commit 46772bf
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions cmd/chainbridge/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,15 @@ func run(ctx *cli.Context) error {
return errors.New("unrecognized Chain Type")
}

if err != nil {
return err
}

if chain.Scan {
c.AddChain(newChain)
} else {
c.SetRouter(newChain)
}

if err != nil {
return err
}

}

// Start prometheus and health server
Expand Down Expand Up @@ -238,7 +237,7 @@ func run(ctx *cli.Context) error {
http.HandleFunc(fmt.Sprintf("/health/%s", c.Name()), h.HealthStatus)
}
// nolint
// ToDo: enable linter after fixint required timeouts vulnerability https://deepsource.io/directory/analyzers/go/issues/GO-S2114
// ToDo: enable linter after fixint required timeouts vulnerability https://deepsource.io/directory/analyzers/go/issues/GO-S2114
err := http.ListenAndServe(fmt.Sprintf(":%d", port), nil)
if errors.Is(err, http.ErrServerClosed) {
log.Info("Health status server is shutting down", err)
Expand Down

0 comments on commit 46772bf

Please sign in to comment.