From ff3e8935c464159b2e436b3d539c5a0c591d61ea Mon Sep 17 00:00:00 2001 From: zlElo Date: Wed, 3 Apr 2024 16:30:49 +0200 Subject: [PATCH] fix catching error --- froggius/logger.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/froggius/logger.py b/froggius/logger.py index dcd3921..dff1e06 100644 --- a/froggius/logger.py +++ b/froggius/logger.py @@ -105,7 +105,7 @@ def error(self, log_msg, file_path=None, highlighting=True, print_out=None, line print(log_string, file=sys.stderr) @staticmethod - def catch(self, file_path=None, continue_onexpception=True): + def catch(file_path=None, continue_onexpception=True): """ A decorator that catches exceptions and logs them with LogMx.error @@ -129,7 +129,8 @@ def wrapper(*args, **kwargs): file = traceback_info[-1][0] function_name = traceback_info[-1][2] - self.error(log_msg=str(e), highlighting=True, print_out=True, line=[line, file, function_name], file_path=file_path) + errorinstance = Froggius() + errorinstance.error(log_msg=str(e), highlighting=True, print_out=True, line=[line, file, function_name], file_path=file_path) if not continue_onexpception: raise e