SIENTIAPDE-1151

Enhance OPC error handling by adding detailed notifications for missing servers during write operations. The notification includes the list of available OPC servers for better debugging.
This commit is contained in:
vitor-aignosi
2025-07-18 14:33:07 -03:00
parent b440c7d547
commit 71d256d192

View File

@@ -125,7 +125,15 @@ class OPC(BaseActivity):
for server_id, config in opc_output_config.items():
if self.opc_repository.get(server_id) is None:
self.error(f"OPC server {server_id} not found", metadata)
message = f"OPC server {server_id} not found to perform write operation."
self.send_notification(
metadata=metadata,
notification_id="OPC_SERVER_NOT_FOUND",
message=message,
block="write_opc_data",
level=NotificationLevel.ERROR,
attachment_content=f"OPC servers: {list(self.opc_repository.keys())}"
)
continue
if 'prediction_tags' in config: