OpenCyphal / yakut

Simple CLI tool for diagnostics and debugging of Cyphal networks
https://opencyphal.org
MIT License
49 stars 10 forks source link

Inaccurate and confusing error message #67

Open pavel-kirienko opened 2 years ago

pavel-kirienko commented 2 years ago

Even if the uavcan namespace is available, you may get this error which is incorrect and badly misleading:

$ y sub 24:uavcan.nonexistent.nested
NotFoundError: Run `yakut compile <path>/uavcan` to compile DSDL namespace 'uavcan'

The problem is not that uavcan is not available (it is!) but rather that it doesn't contain uavcan.nonexistent.

If the last part .nested is removed, we get the correct error message:

NotFoundError: Could not locate nonexistent.*.* in module 'uavcan'
pavel-kirienko commented 2 years ago

The culprit is here:

https://github.com/OpenCyphal/yakut/blob/996e64668d8902bd876fab16b64e3361094a674d/yakut/dtype_loader.py#L68

The error message generated by make_usage_suggestion() is misleading and should be improved as follows: