Skip to content

Commit

Permalink
fix: [expansion:virus_total] Capture ForbiddenError from vr.APIErro…
Browse files Browse the repository at this point in the history
…r correctly
  • Loading branch information
mokaddem committed Sep 3, 2024
1 parent 55b0914 commit 28390ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion misp_modules/modules/expansion/virustotal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 28390ac

Please sign in to comment.