Skip to content

Conversation

@DTCurrie
Copy link
Member

@DTCurrie DTCurrie commented Nov 8, 2025

This PR resolves an issue where the RobotClient.dial method silently swallowed connection errors, making it impossible for developers to detect or handle connection failures.

Previously, if both WebRTC and subsequent gRPC connection attempts failed, the dial method would catch the exceptions, log them to the console, and return this as if the connection were successful.

The method now properly handles connection failures in two ways. For each failed connection attempt (WebRTC or gRPC), a DISCONNECTED event is emitted with the specific error, allowing developers to observe failures through the event system. When both WebRTC and gRPC connection methods fail, the method throws an Error with the message "Failed to connect via all methods". The thrown error includes both original errors in its cause property as an array, providing full context about why the connection failed.

@DTCurrie DTCurrie self-assigned this Nov 8, 2025
@DTCurrie DTCurrie marked this pull request as ready for review November 12, 2025 15:56
@DTCurrie DTCurrie requested a review from a team as a code owner November 12, 2025 15:56
@DTCurrie DTCurrie requested review from lia-viam and njooma and removed request for a team November 12, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants