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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user