if error occures on main thread - simplify error logging

This commit is contained in:
Eriks Karls 2020-01-27 01:53:52 +02:00
parent c7dbeb2078
commit 256a180bd6

View File

@ -345,6 +345,11 @@ def process_error(log_info: str, name: str, exc_info: tuple, citizen=None, commi
trace = inspect.trace()
if trace:
trace = trace[-1][0].f_locals
if trace.get('__name__') == '__main__':
trace = {'commit_id': trace.get('COMMIT_ID'),
'interactive': trace.get('INTERACTIVE'),
'version': trace.get('__version__'),
'config': trace.get('CONFIG')}
else:
trace = dict()
send_email(name, content, citizen, local_vars=trace)