From 711c0c5b395c9f264c12f90836908b89eadf289a Mon Sep 17 00:00:00 2001 From: Heiko Klein Date: Mon, 8 Apr 2024 10:32:54 +0000 Subject: [PATCH] ensure exceptions are not silently suppressed --- pyaerocom/colocation_auto.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyaerocom/colocation_auto.py b/pyaerocom/colocation_auto.py index 5c06fa10e..d03f967c3 100644 --- a/pyaerocom/colocation_auto.py +++ b/pyaerocom/colocation_auto.py @@ -851,12 +851,13 @@ def run(self, var_list: list = None, **opts): # ToDo: see if the following could be solved via custom context manager try: vars_to_process = self.prepare_run(var_list) - except Exception: + except Exception as ex: + logger.exception(ex) if self.raise_exceptions: self._print_processing_status() - self._write_log("ABORTED: raise_exceptions is True\n") + self._write_log(f"ABORTED: raise_exceptions is True: {traceback.format_exc()}\n") self._close_log() - raise + raise ex vars_to_process = {} self._print_coloc_info(vars_to_process) for mod_var, obs_var in vars_to_process.items():