Skip to content

Commit 9094345

Browse files
committedOct 25, 2015
make swarm connect return an error when it fails
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent 795e242 commit 9094345

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎core/commands/swarm.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3
237237

238238
err := n.PeerHost.Connect(ctx, pi)
239239
if err != nil {
240-
output[i] += " failure: " + err.Error()
241-
} else {
242-
output[i] += " success"
240+
res.SetError(fmt.Errorf("%s failure: %s", output[i], err), cmds.ErrNormal)
241+
return
243242
}
243+
output[i] += " success"
244244
}
245245

246246
res.SetOutput(&stringList{output})

0 commit comments

Comments
 (0)
Please sign in to comment.