mirror of https://github.com/MISP/misp-modules
fix: [expansion:virus_total] Capture `ForbiddenError` from vr.APIError correctly
parent
55b0914185
commit
28390ac9ae
|
@ -286,7 +286,10 @@ def dict_handler(request: dict):
|
|||
parser = VirusTotalParser(client, int(event_limit) if event_limit else None)
|
||||
parser.query_api(attribute)
|
||||
except vt.APIError as ex:
|
||||
misperrors['error'] = ex.message
|
||||
if ex.code == 'ForbiddenError':
|
||||
misperrors['error'] = 'ForbiddenError'
|
||||
else:
|
||||
misperrors['error'] = ex.message
|
||||
return misperrors
|
||||
|
||||
return parser.get_result()
|
||||
|
|
Loading…
Reference in New Issue