mirror of https://github.com/MISP/PyMISP
chg: Show size when the json is not loadable.
parent
4962e5c1b2
commit
411104bc83
|
@ -3084,7 +3084,8 @@ class PyMISP:
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.debug(response.text)
|
logger.debug(response.text)
|
||||||
if expect_json:
|
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'):
|
if lenient_response_type and not response.headers['Content-Type'].startswith('application/json'):
|
||||||
return response.text
|
return response.text
|
||||||
if not response.content:
|
if not response.content:
|
||||||
|
|
Loading…
Reference in New Issue