aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDevendra2014-04-24 00:16:57 +0530
committerDevendra2014-04-24 00:16:57 +0530
commit493e29a108255eb3ae3166dc920f40e2f4e5c4c4 (patch)
treebce73bc6014e0b10820ebc1393515f7e3e521b88 /common
parentf7b89bfafae34fa22509c1d1c59d1284ec62c5df (diff)
downloadpubnub-python-493e29a108255eb3ae3166dc920f40e2f4e5c4c4.tar.bz2
adding single file for all platforms
Diffstat (limited to 'common')
-rw-r--r--common/PubnubCoreAsync.py15
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: