cmds/bootstrap: return the correct error on failure
License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
Steven Allen committed
Feb 18, 2019 at 19:23 UTC
cf418cd2db98e354a83f4dd3d07ae6da54b709e8
2 files changed
+5
-1
core/commands/bootstrap.go
+1
-1
@@ -212,7 +212,7 @@ var bootstrapRemoveCmd = &cmds.Command{
212
213
input, perr := config.ParseBootstrapPeers(req.Arguments)
214
if perr != nil {
215
- return err
215
+ return perr
216
}
217
218
removed, err = bootstrapRemove(r, cfg, input)
test/sharness/t0120-bootstrap.sh
+4
@@ -83,6 +83,10 @@ test_bootstrap_cmd() {
83
test_cmp rm_expected rm_actual
84
'
85
86
+ test_expect_success "'ipfs bootstrap rm' fails on bad peers" '
87
+ test_expect_code 1 ipfs bootstrap rm "foo/bar"
88
+ '
89
+
90
test_bootstrap_list_cmd $BP2
91
92
test_expect_success "'ipfs bootstrap add --default' succeeds" '