From f3095c7ccf60de4327c97821f7acc9e53a387cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 10 Jul 2023 12:27:43 +0200 Subject: [PATCH] chg: Add logging when comparing is impossible due to a missing pickle --- lookyloo/comparator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lookyloo/comparator.py b/lookyloo/comparator.py index 242c137..7b86557 100644 --- a/lookyloo/comparator.py +++ b/lookyloo/comparator.py @@ -13,7 +13,7 @@ from redis.connection import UnixDomainSocketConnection from .context import Context from .capturecache import CapturesIndex from .default import get_config, get_socket_path, LookylooException -from .exceptions import MissingUUID +from .exceptions import MissingUUID, TreeNeedsRebuild class CompareSettings(TypedDict): @@ -99,6 +99,9 @@ class Comparator(): to_return['redirects']['nodes'] = [self.get_comparables_node(a) for a in list(reversed(capture.tree.root_hartree.rendered_node.get_ancestors())) + [capture.tree.root_hartree.rendered_node]] to_return['ressources'] = {(a.name, a.hostname) for a in capture.tree.root_hartree.rendered_node.traverse()} + except TreeNeedsRebuild as e: + self.logger.warning(f"The tree for {capture_uuid} couldn't be built.") + to_return = {'error': str(e)} except LookylooException as e: to_return = {'error': str(e)} return to_return