Thanks to visit codestin.com
Credit goes to github.com

Skip to content

v2.4.6

Compare
Choose a tag to compare
@sky-sharma sky-sharma released this 18 Jul 18:39
· 2 commits to master since this release
e713f78

Fix:
IF a timeout happened when calling Messaging.connect() with use_tls (e.g. due to no network connectivity), THEN calling Messaging.connect() again resulted in an error preventing a successful reconnect. This has been fixed

Enhancement:
Inside ClearBladeCore.py, there were several direct calls to exit() on invalid authentication. These have now been replaced with cbErrors.handle() where cbErrors is an object of a new ErrorHandler class.

The generic handle() method is exit(). To override this method a user can create a more specific class and an overriding method as follows:

from clearblade.ClearBladeCore import System, cbErrors

class YourErrorHandler(cbErrors.ErrorHandler):
    def handle(self, code):
        # your custom error handling goes here. Call the super 'handle' (below) if needed
        # super().handle(code)
        print("custom error handling")

cbErrors.ERROR_HANDLER = YourErrorHandler()
...