Skip to content

Commit 4d62fb4

Browse files
committed
Print errors too
1 parent 2a384cc commit 4d62fb4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

cmd/devices-api/tesla_fleet_status.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ func (p *teslaFleetStatusCmd) Execute(ctx context.Context, _ *flag.FlagSet, _ ..
7272

7373
b, err := client.GetFleetStatus(ctx, atPlain, ud.VinIdentifier.String)
7474
if err != nil {
75+
var buf bytes.Buffer
76+
json.Indent(&buf, b, "", " ")
77+
78+
fmt.Println(buf.String())
7579
panic(err)
7680
}
7781

7882
var buf bytes.Buffer
79-
err = json.Indent(&buf, b, "", " ")
80-
if err != nil {
81-
panic(err)
82-
}
83+
json.Indent(&buf, b, "", " ")
8384

8485
fmt.Println(buf.String())
8586

0 commit comments

Comments
 (0)