Skip to content

Commit

Permalink
Log response information on missing 201 response
Browse files Browse the repository at this point in the history
  • Loading branch information
louisheath committed Jan 31, 2025
1 parent 78e39e1 commit 74f47a6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions reconcile/entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ func EntriesClientFromClient(cl *client.ClientWithResponses) EntriesClient {
return nil, err
}

if result == nil {
return nil, errors.New("unexpected nil response")
}
if result.JSON201 == nil {
return nil, errors.New("unexpected nil 201 response")
return nil, errors.Errorf(
`unexpected nil 201 response. Status Code: %d, Content-Type: %s, Bytes Length: %d`,
result.HTTPResponse.StatusCode,
result.HTTPResponse.Header.Get("Content-Type"),
len(result.Body),
)
}

return &result.JSON201.CatalogEntry, nil
Expand Down

0 comments on commit 74f47a6

Please sign in to comment.