improve error reporting system, switch to schedule-v2 format in auto-schedule-pro-v2

This commit is contained in:
2023-09-05 20:40:57 +03:00
parent fc450f633e
commit 2b9ac41ced
3 changed files with 74 additions and 17 deletions
+4
View File
@@ -7,6 +7,7 @@ import sys
import os
import threading
import importlib
import traceback
# global variables
STOP_REQUESTED = False
@@ -57,6 +58,7 @@ class ModuleV1:
return self.RESPONSE
except Exception as e:
print(f"[ERROR] module v1: module \"{self.path}\" ({self.alias}) raised exception \"{e}\"")
print(f"[ERROR] module v1: traceback:\ntraceback.format_exc()")
return ""
@@ -75,6 +77,7 @@ class ModuleV2:
return self.obj.process(msg, self.path)
except Exception as e:
print(f"[ERROR] module v2: module \"{self.path}\" ({self.alias}) raised exception \"{e}\"")
print(f"[ERROR] module v2: traceback:\ntraceback.format_exc()")
return None
@@ -213,6 +216,7 @@ def queue_processor():
time.sleep(1)
except Exception as e:
print(f"[ERROR] queue_processor: current message queue: {message_queue}")
print(f"[ERROR] Traceback:\n{traceback.format_exc()}")
print(f"[ERROR] queue_processor: error while processing message ({e}), trying to delete it...")
try:
del message_queue[0]