Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Commit 9d7b6d2

Browse files
committed
Fix error reporting TCPROSServer
1 parent bc33f0c commit 9d7b6d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

clients/rospy/src/rospy/impl/tcpros_base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,21 @@ def _tcp_server_callback(self, sock, client_addr):
322322
header = read_ros_handshake_header(sock, StringIO(), buff_size)
323323
else:
324324
header = read_ros_handshake_header(sock, BytesIO(), buff_size)
325-
325+
326326
if 'topic' in header:
327327
err_msg = self.topic_connection_handler(sock, client_addr, header)
328328
elif 'service' in header:
329329
err_msg = self.service_connection_handler(sock, client_addr, header)
330330
else:
331331
err_msg = 'no topic or service name detected'
332+
333+
if isinstance(err_msg, dict):
334+
err_msg = err_msg.get('error', 'unhandled connection')
335+
332336
if err_msg:
333337
# shutdown race condition: nodes that come up and down
334338
# quickly can receive connections during teardown.
335-
339+
336340
# We use is_shutdown_requested() because we can get
337341
# into bad connection states during client shutdown
338342
# hooks.

0 commit comments

Comments
 (0)