Skip to content

Commit

Permalink
commands/filestore: print StatusOtherError error
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Overbool <overbool.xu@gmail.com>
  • Loading branch information
overbool committed Nov 6, 2018
1 parent 90167f1 commit f085d13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/commands/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package commands
import (
"fmt"
"io"
"os"

core "github.com/ipfs/go-ipfs/core"
cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv"
Expand Down Expand Up @@ -150,7 +151,7 @@ For ERROR entries the error will also be printed to stderr.
Encoders: cmds.EncoderMap{
cmds.Text: cmds.MakeTypedEncoder(func(req *cmds.Request, w io.Writer, out *filestore.ListRes) error {
if out.Status == filestore.StatusOtherError {
return fmt.Errorf(out.ErrorMsg)
fmt.Fprintf(os.Stderr, "%s\n", out.ErrorMsg)
}
fmt.Fprintf(w, "%s %s\n", out.Status.Format(), out.FormatLong())
return nil
Expand Down

0 comments on commit f085d13

Please sign in to comment.