Skip to content

Commit

Permalink
Merge pull request #1900 from ipfs/fix/swarm-con-err
Browse files Browse the repository at this point in the history
make swarm connect return an error when it fails
  • Loading branch information
jbenet committed Oct 28, 2015
2 parents 4022d8b + 9094345 commit 62cb6eb
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 62cb6eb

Please sign in to comment.