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 Oct 30, 2018
1 parent 28fc08a commit 794e8c7
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 @@ -150,7 +150,8 @@ 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(w, "%s %s\n", out.Status.Format(), out.ErrorMsg)
return nil
}
fmt.Fprintf(w, "%s %s\n", out.Status.Format(), out.FormatLong())
return nil
Expand Down

0 comments on commit 794e8c7

Please sign in to comment.