Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop my own fault recovery logic using gmqtt client #121

Open
emoriones opened this issue Dec 2, 2020 · 0 comments
Open

Develop my own fault recovery logic using gmqtt client #121

emoriones opened this issue Dec 2, 2020 · 0 comments

Comments

@emoriones
Copy link

Hello,

I am trying to implement my own fault handling logic using gmqtt client. To do so, I set reconnect_retries in client config to 0. However, when I am using the client normally an I force a broker error I see the errors are still managed by the client like it can be see in the following logs:

error ERROR HANDLE PKG
warning TRYING WRITE TO CLOSED SOCKET
warning CAN'T RECONNECT 1
error DISCONNECTED max number of failed connection attempts achieved

I noticed the exception I want to propagate to handle the error is always swallowed by the following method in the gmqtt.mqtt.handler module.

def __call__(self, cmd, packet):
        try:
            result = self._handle_packet(cmd, packet)
        except Exception as exc:
            logger.error('[ERROR HANDLE PKG]', exc_info=exc)
            result = None
        return result

Is there a way to avoid this and propagate the exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant