From fdaecf2cbc2a85618132b7e35f03edb1bdf64b1f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 7 Jun 2022 13:36:31 -0400 Subject: [PATCH] Relay input errors to caller in dispatch --- confluent_server/confluent/core.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index fe6c4be4..6d7d9366 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -811,9 +811,17 @@ def handle_dispatch(connection, cert, dispatch, peername): operation = dispatch['operation'] pathcomponents = dispatch['path'] routespec = nested_lookup(noderesources, pathcomponents) - inputdata = msg.get_input_message( - pathcomponents, operation, inputdata, nodes, dispatch['isnoderange'], - configmanager) + try: + inputdata = msg.get_input_message( + pathcomponents, operation, inputdata, nodes, dispatch['isnoderange'], + configmanager) + except Exception as res: + with xmitlock: + _forward_rsp(connection, res) + keepalive.kill() + connection.sendall('\x00\x00\x00\x00\x00\x00\x00\x00') + connection.close() + return plugroute = routespec.routeinfo plugpath = None nodesbyhandler = {}