diff options
Diffstat (limited to 'common/PubnubCoreAsync.py')
| -rw-r--r-- | common/PubnubCoreAsync.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/common/PubnubCoreAsync.py b/common/PubnubCoreAsync.py index f8e9e68..c9a44c3 100644 --- a/common/PubnubCoreAsync.py +++ b/common/PubnubCoreAsync.py @@ -210,6 +210,19 @@ class PubnubCoreAsync(PubnubBase): self._reset_offline() + def error_callback(response): + ## ERROR ? + if not response or \ + ('message' in response and + response['message'] == 'Forbidden'): + _invoke_error(response['payload'][ + 'channels'], response['message']) + _connect() + return + if 'message' in response: + _invoke_error(err=response['message']) + + def sub_callback(response): ## ERROR ? if not response or \ @@ -257,7 +270,7 @@ class PubnubCoreAsync(PubnubBase): str(self.timetoken) ], "urlparams": {"uuid": self.uuid, "auth": self.auth_key}}, sub_callback, - sub_callback, + error_callback, single=True) ''' except Exception as e: |
