@cryptotaxi247 / kubo / commits / 909434587

make swarm connect return an error when it fails

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Oct 25, 2015 at 13:15 UTC 9094345875cc589915dc2c0371dbaa592dd7d713
1 file changed +3 -3
core/commands/swarm.go
+3 -3
@@ -237,10 +237,10 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3
237
238 err := n.PeerHost.Connect(ctx, pi)
239 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
242 }
243 + output[i] += " success"
244 }
245
246 res.SetOutput(&stringList{output})