Skip to content

Commit

Permalink
[ISSUE-73] fix error check in http do (#74)
Browse files Browse the repository at this point in the history
* [ISSUE-73] fix error check in http do

* [issue-73] update allure
  • Loading branch information
siller174 authored May 17, 2024
1 parent b0638c3 commit 0205bc3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.21
require (
github.com/josephburnett/jd v1.7.1
github.com/ohler55/ojg v1.21.1
github.com/ozontech/allure-go/pkg/allure v0.6.13-0.20240320124242-dd7f2ab15350
github.com/ozontech/allure-go/pkg/framework v0.6.30-0.20240320124242-dd7f2ab15350
github.com/ozontech/allure-go/pkg/allure v0.6.13
github.com/ozontech/allure-go/pkg/framework v0.6.31
github.com/stretchr/testify v1.8.4
github.com/xeipuuv/gojsonschema v1.2.0
moul.io/http2curl/v2 v2.3.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/ohler55/ojg v1.21.1 h1:b2RLUaDcy9gvn46dmhTjezu/TDauoR0/kgKTqkwIxto=
github.com/ohler55/ojg v1.21.1/go.mod h1:gQhDVpQLqrmnd2eqGAvJtn+NfKoYJbe/A4Sj3/Vro4o=
github.com/ozontech/allure-go/pkg/allure v0.6.13-0.20240320124242-dd7f2ab15350 h1:IBKoi5yMF3kINxJ5YWRCjitZm2n5jA6kq8qqZu1OmsA=
github.com/ozontech/allure-go/pkg/allure v0.6.13-0.20240320124242-dd7f2ab15350/go.mod h1:4oEG2yq+DGOzJS/ZjPc87C/mx3tAnlYpYonk77Ru/vQ=
github.com/ozontech/allure-go/pkg/framework v0.6.30-0.20240320124242-dd7f2ab15350 h1:QYE7DoTcAIKDd0BKe9epSK8j9bwOaQx0zS4zoGe7LlE=
github.com/ozontech/allure-go/pkg/framework v0.6.30-0.20240320124242-dd7f2ab15350/go.mod h1:ZNUnhean4TKmDwHPX2Jwr3y/o0WTeyuXB9aKKRcyHBg=
github.com/ozontech/allure-go/pkg/allure v0.6.13 h1:vkLSIvOEERHTxe+oq8DXDu/m+kLnVUkrXNN8xTKuKU4=
github.com/ozontech/allure-go/pkg/allure v0.6.13/go.mod h1:4oEG2yq+DGOzJS/ZjPc87C/mx3tAnlYpYonk77Ru/vQ=
github.com/ozontech/allure-go/pkg/framework v0.6.31 h1:u32AqB9/JkzcL5vSl8PSUmMZbsVTmoriDylI3FIYgX4=
github.com/ozontech/allure-go/pkg/framework v0.6.31/go.mod h1:wfqY4e4+w4BoRFDxHp7TNcdWfcCOWJV3BjrUqUughWY=
github.com/pkg/diff v0.0.0-20200914180035-5b29258ca4f7/go.mod h1:zO8QMzTeZd5cpnIkz/Gn6iK0jDfGicM1nynOkkPIl28=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
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 0205bc3

Please sign in to comment.