Improve the exception message for a server 500+ response with no response content

pull/147/head
StrayLightning 2017-12-05 18:04:11 +00:00
parent 8a8b0c113d
commit 748be6a093
1 changed files with 1 additions and 1 deletions

View File

@ -224,7 +224,7 @@ class PyMISP(object):
errors = []
if response.status_code >= 500:
if len(response.content) == 0:
raise PyMISPError('Something bad happened on the server-side and there was no content to be decoded')
raise PyMISPError('Something bad happened on the server-side, but there was no response content to be decoded')
else:
errors.append(response.json())
logger.critical('Something bad happened on the server-side: {}'.format(response.json()))