Skip to content

Commit

Permalink
Send status to stderr if JSON marshaling fails
Browse files Browse the repository at this point in the history
Signed-off-by: Raphaël Pinson <[email protected]>
  • Loading branch information
raphink committed Feb 6, 2023
1 parent 2cad140 commit 684feb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/cli/cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func newCmdStatus() *cobra.Command {
jsonStatus, err := json.MarshalIndent(s, "", " ")
if err != nil {
// Report the most recent status even if an error occurred.
fmt.Print(s.Format())
fmt.Errorf(s.Format())
fatalf("Unable to marshal status to JSON: %s", err)
}
fmt.Println(string(jsonStatus))
Expand Down

0 comments on commit 684feb1

Please sign in to comment.