SIENTIAPDE-1110

Refactor notification handling in Gates and OPC activities to use send_notification method with metadata integration, enhancing error reporting and traceability.
This commit is contained in:
vitor-aignosi
2025-07-04 15:19:14 -03:00
parent 58216a91ce
commit 50e6479c49
12 changed files with 293 additions and 175 deletions

View File

@@ -217,7 +217,7 @@ class OpcRepository():
trace = traceback.format_exc()
self.notification_handler.build_and_send_notification(
notification_id=f"OPC_WRITE_GET_NODE_ERROR_{self.id}",
message=f"Failed to get node from OPC server: {e}",
message=f"Failed to get node from OPC server: {e} | metadata: {metadata}",
block="opc_repository",
level=NotificationLevel.ERROR,
attachment_content=trace
@@ -229,7 +229,7 @@ class OpcRepository():
if data_type not in data_type_map:
self.notification_handler.build_and_send_notification(
notification_id=f"OPC_WRITE_DATA_TYPE_ERROR_{self.id}",
message=f"Unsupported data type: {data_type}",
message=f"Unsupported data type: {data_type} | metadata: {metadata}",
block="opc_repository",
level=NotificationLevel.ERROR
)
@@ -258,7 +258,7 @@ class OpcRepository():
trace = traceback.format_exc()
self.notification_handler.build_and_send_notification(
notification_id=f"OPC_WRITE_DATA_ERROR_{self.id}",
message=f"Failed to write data to OPC server: {e}",
message=f"Failed to write data to OPC server: {e} | metadata: {metadata}",
block="opc_repository",
level=NotificationLevel.ERROR,
attachment_content=trace