diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4f184f44..5fa626ea 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 diff --git a/brewtils/rest/easy_client.py b/brewtils/rest/easy_client.py index eece1d78..84a5d4da 100644 --- a/brewtils/rest/easy_client.py +++ b/brewtils/rest/easy_client.py @@ -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: @@ -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: @@ -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) diff --git a/test/rest/conftest.py b/test/rest/conftest.py index 3e8c5369..64564628 100644 --- a/test/rest/conftest.py +++ b/test/rest/conftest.py @@ -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