SIENTIAPDE-1151

refactor: enhance error handling in build_tag_config and slot processing to include notifications for missing servers
This commit is contained in:
vitor-aignosi
2025-07-18 09:45:42 -03:00
parent 7c92bd2584
commit 92fbb704f5
2 changed files with 27 additions and 4 deletions

View File

@@ -146,6 +146,10 @@ def gather_read_tags(pipelines: list[dict[str, Any]]) -> dict[str, Any]:
def build_tag_config(tag: dict[str, Any], slot_config: dict[str, Any],
opc_servers: dict[str, Any], i: int):
server_id = tag['server_id']
if server_id not in opc_servers:
raise ValueError(f"Server {server_id} not found in opc_servers")
server_name = opc_servers[server_id]['server_name']
if server_name not in slot_config[f"{i}"]:
slot_config[f"{i}"][server_name] = {