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 <[email protected]>
  • Loading branch information
overbool committed Oct 30, 2018
1 parent 28fc08a commit d67709a
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 d67709a

Please sign in to comment.