Skip to content

Commit

Permalink
[ISSUE-73] fix error check in http do
Browse files Browse the repository at this point in the history
  • Loading branch information
siller174 committed May 15, 2024
1 parent b0638c3 commit af5b546
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions roundtripper.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,15 @@ func (it *Test) doRequest(t T, baseReq *http.Request) (*http.Response, error) {
}

resp, httpErr := it.httpClient.Do(req)

// http client has case wheh it return response and error in one time
// we have to check this case
if resp == nil {
if httpErr != nil {
return nil, cuteErrors.NewCuteError("[HTTP] Could not do request", httpErr)
}

// if response is nil, we can't get information about request and response
return nil, cuteErrors.NewCuteError("[HTTP] Response is nil", httpErr)
}

Expand Down

0 comments on commit af5b546

Please sign in to comment.