linking: Use sendClientError in link-error handler

The current code was not updated to use `clients_om`, thus never
found a client, ending up never sending client errors.
Just use the shared helper to avoid such issues in the future.
This commit is contained in:
Robert Mader
2024-03-25 13:44:45 +01:00
parent 94031f8ef9
commit 3ffd0956d4

View File

@@ -113,16 +113,7 @@ AsyncEventHook {
}
if si then
local node = si:get_associated_proxy ("node")
local client_id = node.properties["client.id"]
if client_id then
local client = om:lookup {
Constraint { "bound-id", "=", client_id, type = "gobject" }
}
if client then
log:info (node, "sending client error: " .. error_msg)
client:send_error (node["bound-id"], -32, error_msg)
end
end
lutils.sendClientError(event, node, -32, error_msg)
end
end
end)