diff --git a/request.go b/request.go index ff7ad6f..c7e3268 100644 --- a/request.go +++ b/request.go @@ -48,10 +48,6 @@ func Request(ctx context.Context, params RequestOpts) ([]byte, int, error) { return nil, 0, err } - if resp.StatusCode >= 400 { - return nil, resp.StatusCode, errors.New(string(body)) - } - return body, resp.StatusCode, nil } diff --git a/request_test.go b/request_test.go index 0edad83..b805eef 100644 --- a/request_test.go +++ b/request_test.go @@ -71,8 +71,8 @@ func TestRequest(t *testing.T) { URL: ts.URL, InjectBearer: true, }) - require.Error(t, err) - require.Nil(t, resp) + require.NoError(t, err) + require.NotNil(t, resp) require.Equal(t, http.StatusBadRequest, code) })