Skip to content

Commit

Permalink
Show HTTP body when there is an error
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Jan 22, 2025
1 parent 3a559f0 commit 376d8bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/controller_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func runControllerLogsE(cmd *cobra.Command, args []string) error {
}

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

fmt.Println(res)
Expand Down
3 changes: 1 addition & 2 deletions cmd/runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,12 @@ func runRunnersE(cmd *cobra.Command, args []string) error {
c := pkg.NewClient(http.DefaultClient, os.Getenv("ACTUATED_URL"))

res, status, err := c.ListRunners(pat, owner, staff, images, requestJson)

if err != nil {
return err
}

if status != http.StatusOK {
return fmt.Errorf("unexpected status code: %d", status)
return fmt.Errorf("unexpected status code: %d, message: %s", status, res)
}

if requestJson {
Expand Down

0 comments on commit 376d8bc

Please sign in to comment.