Skip to content

Commit

Permalink
fix catching error
Browse files Browse the repository at this point in the history
  • Loading branch information
zlElo committed Apr 3, 2024
1 parent 079d29a commit ff3e893
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions froggius/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ff3e893

Please sign in to comment.