Fix MQTT error handling

- Fix "Out of memory" errors
- Fix typo
This commit is contained in:
Mads Marquart
2020-01-06 13:14:07 +01:00
parent b199d597b2
commit b4d3769fd5
2 changed files with 15 additions and 12 deletions

View File

@@ -2835,7 +2835,7 @@ class Client(object):
self._mqtt.set_chat_on(self._markAlive)
# TODO: Remove on_error param
return self._mqtt.loop_once(on_error=self.onListenError)
return self._mqtt.loop_once(on_error=lambda e: self.onListenError(exception=e))
def stopListening(self):
"""Stop the listening loop."""