Skip to content

Commit

Permalink
Print error message as specified format
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuoza committed Feb 26, 2021
1 parent 8eb68d8 commit 4401ba1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/switchbot/command/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (c *InfoCommand) Run(args []string) int {
if cfg.Format == "json" {
err := printAsJson(info)
if err != nil {
msg := fmt.Sprintf("Failed to retreive info from SwitchBot: %s", err.Error())
msg := fmt.Sprintf(`{"error": "Failed to retreive info from SwitchBot: %s"}`, err.Error())
c.UI.Error(msg)
return 1
}
Expand Down

0 comments on commit 4401ba1

Please sign in to comment.