eclipse-paho / eclipse-paho/paho.mqtt.python

Return codes vs. exceptions

Open
#142 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.