Skip to content

Commit 62bb01b

Browse files
committed
fix linter issues
1 parent 22852ce commit 62bb01b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

templates/python/exceptions.mustache

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ class ApiException(OpenApiException):
140140
if http_resp.status == 404:
141141
raise NotFoundException(http_resp=http_resp, body=body, data=data)
142142

143+
# Added new conditions for 409 and 422
144+
if http_resp.status == 409:
145+
raise ConflictException(http_resp=http_resp, body=body, data=data)
146+
147+
if http_resp.status == 422:
148+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
149+
143150
if 500 <= http_resp.status <= 599:
144151
raise ServiceException(http_resp=http_resp, body=body, data=data)
145152
raise ApiException(http_resp=http_resp, body=body, data=data)
@@ -178,6 +185,16 @@ class ServiceException(ApiException):
178185
pass
179186

180187

188+
class ConflictException(ApiException):
189+
"""Exception for HTTP 409 Conflict."""
190+
pass
191+
192+
193+
class UnprocessableEntityException(ApiException):
194+
"""Exception for HTTP 422 Unprocessable Entity."""
195+
pass
196+
197+
181198
def render_path(path_to_item):
182199
"""Returns a string representation of a path"""
183200
result = ""

0 commit comments

Comments
 (0)