From 1ba59bf3d3eec697013f8118073e6e0267675cb8 Mon Sep 17 00:00:00 2001 From: Marenthyu Date: Thu, 16 Nov 2017 14:44:39 +0100 Subject: [PATCH] Add server response on API error to stdout --- ratlib/api/http.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ratlib/api/http.py b/ratlib/api/http.py index 6c197ef..59d6d9f 100644 --- a/ratlib/api/http.py +++ b/ratlib/api/http.py @@ -147,6 +147,9 @@ def call(method, uri, data=None, statuses=None, log=None, headers=None, **kwargs data=json.dumps(data, sort_keys=True, indent=" " * 4) ) ) + if response is not None: + print("Response:") + print(response.text) raise HTTPError(code=ex.response.status_code, details=str(ex)) from ex except exc.RequestException as ex: try: