mirror of https://github.com/MISP/PyMISP
potential fix for the errors not being picked up by pymisp from the response "errors" field
parent
0f6d7907c2
commit
13871dbd77
|
@ -203,9 +203,14 @@ class PyMISP(object):
|
||||||
errors.append(to_return['error'])
|
errors.append(to_return['error'])
|
||||||
else:
|
else:
|
||||||
errors += to_return['error']
|
errors += to_return['error']
|
||||||
|
if to_return.get('errors'):
|
||||||
|
if not isinstance(to_return['errors'], list):
|
||||||
|
errors.append(to_return['errors'])
|
||||||
|
else:
|
||||||
|
errors += to_return['errors']
|
||||||
|
|
||||||
if 400 <= response.status_code < 500:
|
if 400 <= response.status_code < 500:
|
||||||
if to_return.get('error') is None and to_return.get('message'):
|
if not errors and to_return.get('message'):
|
||||||
errors.append(to_return['message'])
|
errors.append(to_return['message'])
|
||||||
else:
|
else:
|
||||||
errors.append(basestring(response.status_code))
|
errors.append(basestring(response.status_code))
|
||||||
|
|
Loading…
Reference in New Issue