From 4e9435d5737665ac932227a51fb4cb0af51d43dd Mon Sep 17 00:00:00 2001 From: John Wilkie <124276291+JBWilkie@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:44:27 +0100 Subject: [PATCH] Improved HTTP error code verbosity (#927) --- darwin/future/core/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/darwin/future/core/client.py b/darwin/future/core/client.py index 847de0678..8ac0e392c 100644 --- a/darwin/future/core/client.py +++ b/darwin/future/core/client.py @@ -263,10 +263,10 @@ def raise_for_darwin_exception(response: requests.Response) -> None: if response.status_code == 200: return if response.status_code == 400: - raise BadRequest(response) + raise BadRequest(response, response.text) if response.status_code == 401: - raise Unauthorized(response) + raise Unauthorized(response, response.text) if response.status_code == 404: - raise NotFound(response) + raise NotFound(response, response.text) if response.status_code == 422: - raise UnprocessibleEntity(response) + raise UnprocessibleEntity(response, response.text)