commands/filestore: print StatusOtherError error
License: MIT Signed-off-by: Overbool <overbool.xu@gmail.com>
Overbool committed
Oct 30, 2018 at 14:26 UTC
c43658621d57aeb492097b5c3ea4b1f1b82a1331
1 file changed
+2
-1
core/commands/filestore.go
+2
-1
@@ -3,6 +3,7 @@ package commands
3
import (
4
"fmt"
5
"io"
6
+ "os"
7
8
core "github.com/ipfs/go-ipfs/core"
9
cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
@@ -150,7 +151,7 @@ For ERROR entries the error will also be printed to stderr.
151
Encoders: cmds.EncoderMap{
152
cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *filestore.ListRes) error {
153
if out.Status == filestore.StatusOtherError {
153
- return fmt.Errorf(out.ErrorMsg)
154
+ fmt.Fprintf(os.Stderr, "%s\n", out.ErrorMsg)
155
}
156
fmt.Fprintf(w, "%s %s\n", out.Status.Format(), out.FormatLong())
157
return nil