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:
@@ -125,7 +125,15 @@ class OPC(BaseActivity):
|
|||||||
|
|
||||||
for server_id, config in opc_output_config.items():
|
for server_id, config in opc_output_config.items():
|
||||||
if self.opc_repository.get(server_id) is None:
|
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
|
continue
|
||||||
|
|
||||||
if 'prediction_tags' in config:
|
if 'prediction_tags' in config:
|
||||||
|
|||||||
Reference in New Issue
Block a user