Skip to content

Commit a31befa

Browse files
feat: Add raise_on_error_code flag to Client
1 parent 08bc2ac commit a31befa

33 files changed

+183
-1
lines changed

end_to_end_tests/golden-record/my_test_api_client/api/default/get_common_parameters.py

+6
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def sync_detailed(
6363
**kwargs,
6464
)
6565

66+
if client.raise_on_error_code:
67+
response.raise_for_status()
68+
6669
return _build_response(response=response)
6770

6871

@@ -87,4 +90,7 @@ async def asyncio_detailed(
8790
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
8891
response = await _client.request(**kwargs)
8992

93+
if client.raise_on_error_code:
94+
response.raise_for_status()
95+
9096
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/default/post_common_parameters.py

+6
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def sync_detailed(
6363
**kwargs,
6464
)
6565

66+
if client.raise_on_error_code:
67+
response.raise_for_status()
68+
6669
return _build_response(response=response)
6770

6871

@@ -87,4 +90,7 @@ async def asyncio_detailed(
8790
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
8891
response = await _client.request(**kwargs)
8992

93+
if client.raise_on_error_code:
94+
response.raise_for_status()
95+
9096
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_header_types.py

+6
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def sync_detailed(
8181
**kwargs,
8282
)
8383

84+
if client.raise_on_error_code:
85+
response.raise_for_status()
86+
8487
return _build_response(response=response)
8588

8689

@@ -114,4 +117,7 @@ async def asyncio_detailed(
114117
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
115118
response = await _client.request(**kwargs)
116119

120+
if client.raise_on_error_code:
121+
response.raise_for_status()
122+
117123
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/location/get_location_query_optionality.py

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ def sync_detailed(
9696
**kwargs,
9797
)
9898

99+
if client.raise_on_error_code:
100+
response.raise_for_status()
101+
99102
return _build_response(response=response)
100103

101104

@@ -129,4 +132,7 @@ async def asyncio_detailed(
129132
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
130133
response = await _client.request(**kwargs)
131134

135+
if client.raise_on_error_code:
136+
response.raise_for_status()
137+
132138
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/parameters/delete_common_parameters_overriding_param.py

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def sync_detailed(
6767
**kwargs,
6868
)
6969

70+
if client.raise_on_error_code:
71+
response.raise_for_status()
72+
7073
return _build_response(response=response)
7174

7275

@@ -94,4 +97,7 @@ async def asyncio_detailed(
9497
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
9598
response = await _client.request(**kwargs)
9699

100+
if client.raise_on_error_code:
101+
response.raise_for_status()
102+
97103
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_common_parameters_overriding_param.py

+6
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def sync_detailed(
6969
**kwargs,
7070
)
7171

72+
if client.raise_on_error_code:
73+
response.raise_for_status()
74+
7275
return _build_response(response=response)
7376

7477

@@ -98,4 +101,7 @@ async def asyncio_detailed(
98101
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
99102
response = await _client.request(**kwargs)
100103

104+
if client.raise_on_error_code:
105+
response.raise_for_status()
106+
101107
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/parameters/get_same_name_multiple_locations_param.py

+6
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ def sync_detailed(
8181
**kwargs,
8282
)
8383

84+
if client.raise_on_error_code:
85+
response.raise_for_status()
86+
8487
return _build_response(response=response)
8588

8689

@@ -114,4 +117,7 @@ async def asyncio_detailed(
114117
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
115118
response = await _client.request(**kwargs)
116119

120+
if client.raise_on_error_code:
121+
response.raise_for_status()
122+
117123
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/parameters/multiple_path_parameters.py

+6
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def sync_detailed(
7171
**kwargs,
7272
)
7373

74+
if client.raise_on_error_code:
75+
response.raise_for_status()
76+
7477
return _build_response(response=response)
7578

7679

@@ -104,4 +107,7 @@ async def asyncio_detailed(
104107
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
105108
response = await _client.request(**kwargs)
106109

110+
if client.raise_on_error_code:
111+
response.raise_for_status()
112+
107113
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/tag1/get_tag_with_number.py

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ def sync_detailed(
5151
**kwargs,
5252
)
5353

54+
if client.raise_on_error_code:
55+
response.raise_for_status()
56+
5457
return _build_response(response=response)
5558

5659

@@ -70,4 +73,7 @@ async def asyncio_detailed(
7073
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
7174
response = await _client.request(**kwargs)
7275

76+
if client.raise_on_error_code:
77+
response.raise_for_status()
78+
7379
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py

+6
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ def sync_detailed(
169169
**kwargs,
170170
)
171171

172+
if client.raise_on_error_code:
173+
response.raise_for_status()
174+
172175
return _build_response(response=response)
173176

174177

@@ -274,6 +277,9 @@ async def asyncio_detailed(
274277
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
275278
response = await _client.request(**kwargs)
276279

280+
if client.raise_on_error_code:
281+
response.raise_for_status()
282+
277283
return _build_response(response=response)
278284

279285

end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_booleans.py

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def sync_detailed(
6262
**kwargs,
6363
)
6464

65+
if client.raise_on_error_code:
66+
response.raise_for_status()
67+
6568
return _build_response(response=response)
6669

6770

@@ -101,6 +104,9 @@ async def asyncio_detailed(
101104
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
102105
response = await _client.request(**kwargs)
103106

107+
if client.raise_on_error_code:
108+
response.raise_for_status()
109+
104110
return _build_response(response=response)
105111

106112

end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_floats.py

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def sync_detailed(
6262
**kwargs,
6363
)
6464

65+
if client.raise_on_error_code:
66+
response.raise_for_status()
67+
6568
return _build_response(response=response)
6669

6770

@@ -101,6 +104,9 @@ async def asyncio_detailed(
101104
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
102105
response = await _client.request(**kwargs)
103106

107+
if client.raise_on_error_code:
108+
response.raise_for_status()
109+
104110
return _build_response(response=response)
105111

106112

end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_integers.py

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def sync_detailed(
6262
**kwargs,
6363
)
6464

65+
if client.raise_on_error_code:
66+
response.raise_for_status()
67+
6568
return _build_response(response=response)
6669

6770

@@ -101,6 +104,9 @@ async def asyncio_detailed(
101104
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
102105
response = await _client.request(**kwargs)
103106

107+
if client.raise_on_error_code:
108+
response.raise_for_status()
109+
104110
return _build_response(response=response)
105111

106112

end_to_end_tests/golden-record/my_test_api_client/api/tests/get_basic_list_of_strings.py

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def sync_detailed(
6262
**kwargs,
6363
)
6464

65+
if client.raise_on_error_code:
66+
response.raise_for_status()
67+
6568
return _build_response(response=response)
6669

6770

@@ -101,6 +104,9 @@ async def asyncio_detailed(
101104
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
102105
response = await _client.request(**kwargs)
103106

107+
if client.raise_on_error_code:
108+
response.raise_for_status()
109+
104110
return _build_response(response=response)
105111

106112

end_to_end_tests/golden-record/my_test_api_client/api/tests/get_user_list.py

+6
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ def sync_detailed(
131131
**kwargs,
132132
)
133133

134+
if client.raise_on_error_code:
135+
response.raise_for_status()
136+
134137
return _build_response(response=response)
135138

136139

@@ -198,6 +201,9 @@ async def asyncio_detailed(
198201
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
199202
response = await _client.request(**kwargs)
200203

204+
if client.raise_on_error_code:
205+
response.raise_for_status()
206+
201207
return _build_response(response=response)
202208

203209

end_to_end_tests/golden-record/my_test_api_client/api/tests/int_enum_tests_int_enum_post.py

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ def sync_detailed(
7979
**kwargs,
8080
)
8181

82+
if client.raise_on_error_code:
83+
response.raise_for_status()
84+
8285
return _build_response(response=response)
8386

8487

@@ -124,6 +127,9 @@ async def asyncio_detailed(
124127
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
125128
response = await _client.request(**kwargs)
126129

130+
if client.raise_on_error_code:
131+
response.raise_for_status()
132+
127133
return _build_response(response=response)
128134

129135

end_to_end_tests/golden-record/my_test_api_client/api/tests/json_body_tests_json_body_post.py

+6
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def sync_detailed(
7676
**kwargs,
7777
)
7878

79+
if client.raise_on_error_code:
80+
response.raise_for_status()
81+
7982
return _build_response(response=response)
8083

8184

@@ -125,6 +128,9 @@ async def asyncio_detailed(
125128
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
126129
response = await _client.request(**kwargs)
127130

131+
if client.raise_on_error_code:
132+
response.raise_for_status()
133+
128134
return _build_response(response=response)
129135

130136

end_to_end_tests/golden-record/my_test_api_client/api/tests/no_response_tests_no_response_get.py

+6
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ def sync_detailed(
5252
**kwargs,
5353
)
5454

55+
if client.raise_on_error_code:
56+
response.raise_for_status()
57+
5558
return _build_response(response=response)
5659

5760

@@ -72,4 +75,7 @@ async def asyncio_detailed(
7275
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
7376
response = await _client.request(**kwargs)
7477

78+
if client.raise_on_error_code:
79+
response.raise_for_status()
80+
7581
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/tests/octet_stream_tests_octet_stream_get.py

+6
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ def sync_detailed(
6161
**kwargs,
6262
)
6363

64+
if client.raise_on_error_code:
65+
response.raise_for_status()
66+
6467
return _build_response(response=response)
6568

6669

@@ -96,6 +99,9 @@ async def asyncio_detailed(
9699
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
97100
response = await _client.request(**kwargs)
98101

102+
if client.raise_on_error_code:
103+
response.raise_for_status()
104+
99105
return _build_response(response=response)
100106

101107

end_to_end_tests/golden-record/my_test_api_client/api/tests/post_form_data.py

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ def sync_detailed(
5959
**kwargs,
6060
)
6161

62+
if client.raise_on_error_code:
63+
response.raise_for_status()
64+
6265
return _build_response(response=response)
6366

6467

@@ -83,4 +86,7 @@ async def asyncio_detailed(
8386
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
8487
response = await _client.request(**kwargs)
8588

89+
if client.raise_on_error_code:
90+
response.raise_for_status()
91+
8692
return _build_response(response=response)

end_to_end_tests/golden-record/my_test_api_client/api/tests/post_tests_json_body_string.py

+6
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ def sync_detailed(
7373
**kwargs,
7474
)
7575

76+
if client.raise_on_error_code:
77+
response.raise_for_status()
78+
7679
return _build_response(response=response)
7780

7881

@@ -118,6 +121,9 @@ async def asyncio_detailed(
118121
async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
119122
response = await _client.request(**kwargs)
120123

124+
if client.raise_on_error_code:
125+
response.raise_for_status()
126+
121127
return _build_response(response=response)
122128

123129

0 commit comments

Comments
 (0)