From c3a04739e719da658be7ddfb4659a36577dee1b8 Mon Sep 17 00:00:00 2001 From: "jj-author@users.noreply.github.com" Date: Tue, 22 Oct 2024 09:24:51 +0200 Subject: [PATCH] try-catch for archivo logic in do_intercept --- ontologytimemachine/custom_proxy.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ontologytimemachine/custom_proxy.py b/ontologytimemachine/custom_proxy.py index 145b1f4..9b60ec0 100644 --- a/ontologytimemachine/custom_proxy.py +++ b/ontologytimemachine/custom_proxy.py @@ -108,9 +108,12 @@ def do_intercept(self, _request: HttpParser) -> bool: # this should actually be not triggered as the CONNECT request should have been blocked before return False elif config.httpsInterception == HttpsInterception.ARCHIVO: - if is_archivo_ontology_request(wrapped_request): - logger.info("Intercepting HTTPS request since it is an Archivo ontology request") - return True + try: + if is_archivo_ontology_request(wrapped_request): + logger.info("Intercepting HTTPS request since it is an Archivo ontology request") + return True + except Exception as e: + logger.error(f"Error while checking if request is an Archivo ontology request: {e}", exc_info=True) logger.info("No Interception of HTTPS request since it is NOT an Archivo ontology request") return False else: