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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

Lines changed: 6 additions & 0 deletions
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

0 commit comments

Comments
 (0)