diff --git a/core/commands/filestore.go b/core/commands/filestore.go index 923be57a5..634740896 100644 --- a/core/commands/filestore.go +++ b/core/commands/filestore.go @@ -86,9 +86,7 @@ The output is: r, ok := v.(*filestore.ListRes) if !ok { - // TODO or just return that error? why didn't we do that before? - log.Error(e.New(e.TypeErr(r, v))) - break + return e.New(e.TypeErr(r, v)) } if r.ErrorMsg != "" { diff --git a/core/commands/repo.go b/core/commands/repo.go index 9506d8817..7df2fce4e 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -2,6 +2,7 @@ package commands import ( "bytes" + "errors" "fmt" "io" "os" @@ -99,7 +100,7 @@ order to reclaim hard disk space. } } if errs { - outChan <- &GcResult{Error: "encountered errors during gc run"} + res.SetError(errors.New("encountered errors during gc run"), cmdkit.ErrNormal) } } else { err := corerepo.CollectResult(req.Context(), gcOutChan, func(k cid.Cid) {