mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-06 11:26:11 +00:00
fix: Raise exceptions on non-2xx responses (#16999)
This commit is contained in:
@@ -304,7 +304,6 @@ class ApiClient:
|
|||||||
# if not found, look for '1XX', '2XX', etc.
|
# if not found, look for '1XX', '2XX', etc.
|
||||||
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
||||||
|
|
||||||
if response_type is None:
|
|
||||||
if not 200 <= response_data.status <= 299:
|
if not 200 <= response_data.status <= 299:
|
||||||
if response_data.status == 400:
|
if response_data.status == 400:
|
||||||
raise BadRequestException(http_resp=response_data)
|
raise BadRequestException(http_resp=response_data)
|
||||||
|
|||||||
@@ -297,7 +297,6 @@ class ApiClient:
|
|||||||
# if not found, look for '1XX', '2XX', etc.
|
# if not found, look for '1XX', '2XX', etc.
|
||||||
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
||||||
|
|
||||||
if response_type is None:
|
|
||||||
if not 200 <= response_data.status <= 299:
|
if not 200 <= response_data.status <= 299:
|
||||||
if response_data.status == 400:
|
if response_data.status == 400:
|
||||||
raise BadRequestException(http_resp=response_data)
|
raise BadRequestException(http_resp=response_data)
|
||||||
|
|||||||
@@ -297,7 +297,6 @@ class ApiClient:
|
|||||||
# if not found, look for '1XX', '2XX', etc.
|
# if not found, look for '1XX', '2XX', etc.
|
||||||
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
||||||
|
|
||||||
if response_type is None:
|
|
||||||
if not 200 <= response_data.status <= 299:
|
if not 200 <= response_data.status <= 299:
|
||||||
if response_data.status == 400:
|
if response_data.status == 400:
|
||||||
raise BadRequestException(http_resp=response_data)
|
raise BadRequestException(http_resp=response_data)
|
||||||
|
|||||||
@@ -299,7 +299,6 @@ class ApiClient:
|
|||||||
# if not found, look for '1XX', '2XX', etc.
|
# if not found, look for '1XX', '2XX', etc.
|
||||||
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
||||||
|
|
||||||
if response_type is None:
|
|
||||||
if not 200 <= response_data.status <= 299:
|
if not 200 <= response_data.status <= 299:
|
||||||
if response_data.status == 400:
|
if response_data.status == 400:
|
||||||
raise BadRequestException(http_resp=response_data)
|
raise BadRequestException(http_resp=response_data)
|
||||||
|
|||||||
@@ -296,7 +296,6 @@ class ApiClient:
|
|||||||
# if not found, look for '1XX', '2XX', etc.
|
# if not found, look for '1XX', '2XX', etc.
|
||||||
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
|
||||||
|
|
||||||
if response_type is None:
|
|
||||||
if not 200 <= response_data.status <= 299:
|
if not 200 <= response_data.status <= 299:
|
||||||
if response_data.status == 400:
|
if response_data.status == 400:
|
||||||
raise BadRequestException(http_resp=response_data)
|
raise BadRequestException(http_resp=response_data)
|
||||||
|
|||||||
Reference in New Issue
Block a user