Skip to content

Commit

Permalink
kwild: failBuild was no-op if error was nil (#892)
Browse files Browse the repository at this point in the history
  • Loading branch information
jchappelow authored Jul 18, 2024
1 parent ce85f23 commit 096043f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/kwild/server/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -922,12 +922,17 @@ func (pe panicErr) Unwrap() error {
}

func failBuild(err error, msg string) {
if err != nil {
if err == nil {
panic(panicErr{
err: err,
msg: fmt.Sprintf("%s: %s", msg, err),
err: errors.New(msg),
msg: msg,
})
}

panic(panicErr{
err: err,
msg: fmt.Sprintf("%s: %s", msg, err),
})
}

func buildListenerManager(d *coreDependencies, ev *voting.EventStore, node *cometbft.CometBftNode, txapp *txapp.TxApp, db sql.ReadTxMaker) *listeners.ListenerManager {
Expand Down

0 comments on commit 096043f

Please sign in to comment.