From ae1bdda67c70c08c32354ec77152e164b59c9840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 19 Jan 2021 18:02:25 +0100 Subject: [PATCH] chg: Show size when the json is not loadable. --- pymisp/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymisp/api.py b/pymisp/api.py index 0c23ad5..eff19c0 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -3108,7 +3108,8 @@ class PyMISP: except Exception: logger.debug(response.text) if expect_json: - raise PyMISPUnexpectedResponse(f'Unexpected response from server: {response.text}') + error_msg = f'Unexpected response (size: {len(response.text)}) from server: {response.text}' + raise PyMISPUnexpectedResponse(error_msg) if lenient_response_type and not response.headers['Content-Type'].startswith('application/json'): return response.text if not response.content: