(cherry picked from commit 4aa5e7e69e)
Co-authored-by: Todd Treece <360020+toddtreece@users.noreply.github.com>
This commit is contained in:
co-authored by
Todd Treece
parent
4f284f167e
commit
bb801de9ed
@@ -58,7 +58,11 @@ func (r *Resource) fetch(ctx context.Context, client *client.Client, req *backen
|
|||||||
|
|
||||||
resp, err := client.QueryResource(ctx, req.Method, u.Path, u.Query())
|
resp, err := client.QueryResource(ctx, req.Method, u.Path, u.Query())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resp.StatusCode, nil, err
|
statusCode := 500
|
||||||
|
if resp != nil {
|
||||||
|
statusCode = resp.StatusCode
|
||||||
|
}
|
||||||
|
return statusCode, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
defer resp.Body.Close() //nolint (we don't care about the error being returned by resp.Body.Close())
|
defer resp.Body.Close() //nolint (we don't care about the error being returned by resp.Body.Close())
|
||||||
|
|||||||
Reference in New Issue
Block a user