Skip to content

Commit 376d8bc

Browse files
committed
Show HTTP body when there is an error
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
1 parent 3a559f0 commit 376d8bc

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

cmd/controller_logs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func runControllerLogsE(cmd *cobra.Command, args []string) error {
5656
}
5757

5858
if status != http.StatusOK {
59-
return fmt.Errorf("unexpected status code: %d, body: %s", status, res)
59+
return fmt.Errorf("unexpected status code: %d, message: %s", status, res)
6060
}
6161

6262
fmt.Println(res)

cmd/runners.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,12 @@ func runRunnersE(cmd *cobra.Command, args []string) error {
6969
c := pkg.NewClient(http.DefaultClient, os.Getenv("ACTUATED_URL"))
7070

7171
res, status, err := c.ListRunners(pat, owner, staff, images, requestJson)
72-
7372
if err != nil {
7473
return err
7574
}
7675

7776
if status != http.StatusOK {
78-
return fmt.Errorf("unexpected status code: %d", status)
77+
return fmt.Errorf("unexpected status code: %d, message: %s", status, res)
7978
}
8079

8180
if requestJson {

0 commit comments

Comments
 (0)