Skip to content

Commit

Permalink
make swarm connect return an error when it fails
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jeromy <[email protected]>
  • Loading branch information
whyrusleeping committed Oct 25, 2015
1 parent 795e242 commit 9094345
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/commands/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3

err := n.PeerHost.Connect(ctx, pi)
if err != nil {
output[i] += " failure: " + err.Error()
} else {
output[i] += " success"
res.SetError(fmt.Errorf("%s failure: %s", output[i], err), cmds.ErrNormal)
return
}
output[i] += " success"
}

res.SetOutput(&stringList{output})
Expand Down

0 comments on commit 9094345

Please sign in to comment.