Skip to content

Commit 0413d00

Browse files
Handle ROUTING_APP error response in onResponseTraceRoute
Previously, receiving a ROUTING_APP packet in response to a traceroute would cause the function to attempt parsing it as a RouteDiscovery payload, resulting in a crash or silent failure followed by a timeout. This mirrors the error handling already present in onResponseTelemetry and onResponseWaypoint, but displays the specific errorReason instead of a hardcoded firmware version message, since traceroute is a diagnostic tool where the exact failure reason is more valuable. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8f0faf5 commit 0413d00

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

meshtastic/mesh_interface.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,12 @@ def sendTraceRoute(
687687

688688
def onResponseTraceRoute(self, p: dict):
689689
"""on response for trace route"""
690+
if p["decoded"]["portnum"] == "ROUTING_APP":
691+
error = p["decoded"]["routing"]["errorReason"]
692+
print(f"Traceroute failed: {error}")
693+
self._acknowledgment.receivedTraceRoute = True
694+
return
695+
690696
UNK_SNR = -128 # Value representing unknown SNR
691697

692698
routeDiscovery = mesh_pb2.RouteDiscovery()

0 commit comments

Comments
 (0)