From 25e9a30bce81f04e372772d7fe288a55e9b00411 Mon Sep 17 00:00:00 2001 From: Saurabh Misra Date: Sun, 16 Mar 2025 21:36:06 -0700 Subject: [PATCH] catch stray exceptions in comparator that can happen when dealing with user objects. Currently codeflash crashes when an exception is raised here. --- codeflash/verification/comparator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codeflash/verification/comparator.py b/codeflash/verification/comparator.py index 22b91a079..ef4f8fadd 100644 --- a/codeflash/verification/comparator.py +++ b/codeflash/verification/comparator.py @@ -244,3 +244,7 @@ def comparator(orig: Any, new: Any, superset_obj=False) -> bool: logger.error(f"RecursionError while comparing objects: {e}") sentry_sdk.capture_exception(e) return False + except Exception as e: + logger.error(f"Error while comparing objects: {e}") + sentry_sdk.capture_exception(e) + return False