v2.4.6
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()
...