meshtastic / python

The Python CLI and API for talking to Meshtastic devices
https://meshtastic.org
410 stars 170 forks source link

Error handling makes it impossible to use as library #703

Open broglep opened 2 weeks ago

broglep commented 2 weeks ago

The current approach of calling sys.exit() when a failure happens makes it impossible to use the library as part of an other project (e.g. home assistant integration)

Workaround of monkey patching that method does also not fully work as then the code flow continues and does not abort.

Example: https://github.com/meshtastic/python/blob/master/meshtastic/mesh_interface.py#L444