From cf418cd2db98e354a83f4dd3d07ae6da54b709e8 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 18 Feb 2019 19:23:44 -0800 Subject: [PATCH] cmds/bootstrap: return the correct error on failure License: MIT Signed-off-by: Steven Allen --- core/commands/bootstrap.go | 2 +- test/sharness/t0120-bootstrap.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/commands/bootstrap.go b/core/commands/bootstrap.go index ac79b8314..403f3ac94 100644 --- a/core/commands/bootstrap.go +++ b/core/commands/bootstrap.go @@ -212,7 +212,7 @@ var bootstrapRemoveCmd = &cmds.Command{ input, perr := config.ParseBootstrapPeers(req.Arguments) if perr != nil { - return err + return perr } removed, err = bootstrapRemove(r, cfg, input) diff --git a/test/sharness/t0120-bootstrap.sh b/test/sharness/t0120-bootstrap.sh index 589fea8c2..2314a02a2 100755 --- a/test/sharness/t0120-bootstrap.sh +++ b/test/sharness/t0120-bootstrap.sh @@ -83,6 +83,10 @@ test_bootstrap_cmd() { test_cmp rm_expected rm_actual ' + test_expect_success "'ipfs bootstrap rm' fails on bad peers" ' + test_expect_code 1 ipfs bootstrap rm "foo/bar" + ' + test_bootstrap_list_cmd $BP2 test_expect_success "'ipfs bootstrap add --default' succeeds" '