eclipse-paho / eclipse-paho/paho.mqtt.python
Return codes vs. exceptions
Open
Status: Available
Type: Enhancement
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 742
- Avg merge
- 12d 48m
- Merged PRs (30d)
- 1
Description
I've noticed in a few parts of the code (especially functions that handle sockets) return codes and exceptions are both used, which means when using the library you often need to have both an exception handler and some extra code which checks what was returned from the function.
I think a lot of people will happily argue about what is 'pythonic' until the cows come home, but it would be nice if there was some kind of MQTTError class which wrapped all the return codes. I realise this might be quite a big change though!
Contributor guide
Assessment
This issue has not been assessed yet.