From f87ae25e2d2fef5e07ef49bcd5624834e1a484fe Mon Sep 17 00:00:00 2001 From: Vadim Laletin Date: Fri, 22 Nov 2024 16:04:02 +0100 Subject: [PATCH] fix: handle parse errors during watch --- fhirsnake/watch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fhirsnake/watch.py b/fhirsnake/watch.py index e469b49..521c180 100644 --- a/fhirsnake/watch.py +++ b/fhirsnake/watch.py @@ -36,12 +36,11 @@ def on_modified(self, event): def process_file(self, file_path): try: resource = load_resource(self.target_dir, file_path) - except Exception: - logging.exception("Unable to load resource %s", file_path) + except Exception as exc: + logging.error("Unable to load resource %s:\a\n%s", file_path, exc) return if resource is None: - logging.error("Unable to load resource %s", file_path) return resource_type = resource["resourceType"]