diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index d8083c6..1a7dd6e 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -689,7 +689,8 @@ class MeshInterface: # pylint: disable=R0902 """on response for trace route""" if p["decoded"]["portnum"] == "ROUTING_APP": error = p["decoded"]["routing"]["errorReason"] - print(f"Traceroute failed: {error}") + if error != "NONE": + print(f"Traceroute failed: {error}") self._acknowledgment.receivedTraceRoute = True return diff --git a/meshtastic/tests/test_mesh_interface.py b/meshtastic/tests/test_mesh_interface.py index d002c18..7f0a9f5 100644 --- a/meshtastic/tests/test_mesh_interface.py +++ b/meshtastic/tests/test_mesh_interface.py @@ -777,3 +777,23 @@ def test_onResponseTraceRoute_routing_error(capsys): assert iface._acknowledgment.receivedTraceRoute is True out, _ = capsys.readouterr() assert "Traceroute failed: MAX_RETRANSMIT" in out + + +@pytest.mark.unit +@pytest.mark.usefixtures("reset_mt_config") +def test_onResponseTraceRoute_routing_none(capsys): + """Test that onResponseTraceRoute does not print error for ROUTING_APP with NONE errorReason.""" + iface = MeshInterface(noProto=True) + + packet = { + "decoded": { + "portnum": "ROUTING_APP", + "routing": {"errorReason": "NONE"}, + } + } + + iface.onResponseTraceRoute(packet) + + assert iface._acknowledgment.receivedTraceRoute is True + out, _ = capsys.readouterr() + assert "Traceroute failed" not in out