fix: [abstract module] exception traceback #145

This commit is contained in:
Terrtia 2022-05-20 14:45:46 +02:00
parent df4bb531d2
commit 512e61cadc
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -102,6 +102,7 @@ class AbstractModule(ABC):
self.compute(message) self.compute(message)
except Exception as err: except Exception as err:
trace = traceback.format_tb(err.__traceback__) trace = traceback.format_tb(err.__traceback__)
trace = ''.join(trace)
self.redis_logger.critical(f"Error in module {self.module_name}: {err}") self.redis_logger.critical(f"Error in module {self.module_name}: {err}")
self.redis_logger.critical(f"Module {self.module_name} input message: {message}") self.redis_logger.critical(f"Module {self.module_name} input message: {message}")
self.redis_logger.critical(trace) self.redis_logger.critical(trace)
@ -109,8 +110,7 @@ class AbstractModule(ABC):
print(f"ERROR: {err}") print(f"ERROR: {err}")
print(f'MESSAGE: {message}') print(f'MESSAGE: {message}')
print('TRACEBACK:') print('TRACEBACK:')
for line in trace: print(trace)
print(line)
# remove from set_module # remove from set_module
## check if item process == completed ## check if item process == completed