From 780590cee30db3bd96b4f6ceb5de45020e628325 Mon Sep 17 00:00:00 2001 From: chrisr3d Date: Tue, 4 May 2021 18:36:56 +0200 Subject: [PATCH] fix: [farsight_passivedns] Handling exceptions raised from a query error - This can happen with for instance a wrong server URL --- misp_modules/modules/expansion/farsight_passivedns.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misp_modules/modules/expansion/farsight_passivedns.py b/misp_modules/modules/expansion/farsight_passivedns.py index 93337a3..47e7eaa 100755 --- a/misp_modules/modules/expansion/farsight_passivedns.py +++ b/misp_modules/modules/expansion/farsight_passivedns.py @@ -148,6 +148,8 @@ def handler(q=False): response = to_query(client, *args) except dnsdb2.DnsdbException as e: return {'error': e.__str__()} + except dnsdb2.exceptions.QueryError: + return {'error': 'Communication error occurs while executing a query, or the server reports an error due to invalid arguments.'} if not response: return {'error': f"Empty results on Farsight DNSDB for the {TYPE_TO_FEATURE[attribute['type']]}: {attribute['value']}."} parser = FarsightDnsdbParser(attribute)