Skip to content

Commit

Permalink
Merge branch 'develop' into drop_2_7
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBurchLog authored Dec 2, 2024
2 parents 36a5f9a + 63bfd72 commit 216ca36
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Brewtils Changelog
==================

TBD
3.29.1
------
TBD

- Updated Wait Timeout Exception expected HTTP code from 408 to 504
- Dropping Official Python 2.7 Support

3.29.0
Expand Down
6 changes: 3 additions & 3 deletions brewtils/rest/easy_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def handle_response_failure(response, default_exc=RestError, raise_404=True):
Raises:
NotFoundError: Status code 404 and raise_404 is True
WaitExceededError: Status code 408
ConflictError: Status code 409
TooLargeError: Status code 413
ValidationError: Any other 4xx status codes
RestConnectionError: Status code 503
WaitExceededError: Status code 504
default_exc: Any other status code
"""
try:
Expand All @@ -79,8 +79,6 @@ def handle_response_failure(response, default_exc=RestError, raise_404=True):
raise NotFoundError(message)
else:
return None
elif response.status_code == 408:
raise WaitExceededError(message)
elif response.status_code == 409:
raise ConflictError(message)
elif response.status_code == 413:
Expand All @@ -89,6 +87,8 @@ def handle_response_failure(response, default_exc=RestError, raise_404=True):
raise ValidationError(message)
elif response.status_code == 503:
raise RestConnectionError(message)
elif response.status_code == 504:
raise WaitExceededError(message)
else:
raise default_exc(message)

Expand Down
2 changes: 1 addition & 1 deletion test/rest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def not_found():

@pytest.fixture
def wait_exceeded():
return Mock(ok=False, status_code=408, json=Mock(return_value="payload"))
return Mock(ok=False, status_code=504, json=Mock(return_value="payload"))


@pytest.fixture
Expand Down

0 comments on commit 216ca36

Please sign in to comment.