mirror of https://github.com/MISP/PyMISP
Fix error flattening
parent
5bf6f52301
commit
aaaab590f5
|
@ -166,7 +166,14 @@ class PyMISP(object):
|
|||
elif response.get('errors'):
|
||||
if isinstance(response['errors'], dict):
|
||||
for where, errors in response['errors'].items():
|
||||
if isinstance(errors, dict):
|
||||
for where, msg in errors.items():
|
||||
messages.append('Error in {}: {}'.format(where, msg))
|
||||
else:
|
||||
for e in errors:
|
||||
if isinstance(e, str):
|
||||
messages.append(e)
|
||||
continue
|
||||
for type_e, msgs in e.items():
|
||||
for m in msgs:
|
||||
messages.append('Error in {}: {}'.format(where, m))
|
||||
|
|
Loading…
Reference in New Issue