From 28390ac9ae51b8daab332b09e93030a2d878c719 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Tue, 3 Sep 2024 11:13:41 +0200 Subject: [PATCH] fix: [expansion:virus_total] Capture `ForbiddenError` from vr.APIError correctly --- misp_modules/modules/expansion/virustotal.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misp_modules/modules/expansion/virustotal.py b/misp_modules/modules/expansion/virustotal.py index 8d78f393..985b6892 100644 --- a/misp_modules/modules/expansion/virustotal.py +++ b/misp_modules/modules/expansion/virustotal.py @@ -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()