From dcdafd146508f7f1f1a1868a94827bb4d6c1a3de Mon Sep 17 00:00:00 2001 From: Devendra Date: Tue, 9 Jun 2015 01:13:03 +0530 Subject: adding channel param for error callback --- Pubnub.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Pubnub.py b/Pubnub.py index 5580a51..4709e47 100644 --- a/Pubnub.py +++ b/Pubnub.py @@ -991,6 +991,7 @@ class PubnubBase(object): if ("urlparams" in request): url = url + '?' + "&".join([x + "=" + str(y) for x, y in request[ "urlparams"].items() if y is not None and len(str(y)) > 0]) + #print(url) return url def _channel_registry(self, url=None, params=None, callback=None, error=None): @@ -1684,11 +1685,17 @@ class PubnubCoreAsync(PubnubBase): if channel_list is None: for ch in self.subscriptions: chobj = self.subscriptions[ch] - _invoke(chobj['error'], error) + try: + _invoke(chobj['error'], error, ch) + except TypeError: + _invoke(chobj['error'], error) else: for ch in channel_list: chobj = self.subscriptions[ch] - _invoke(chobj['error'], error) + try: + _invoke(chobj['error'], error, ch) + except TypeError: + _invoke(chobj['error'], error) def _get_channel(): for ch in self.subscriptions: @@ -2107,6 +2114,8 @@ def _requests_request(url, timeout=5): except requests.exceptions.Timeout as error: msg = str(error) return (json.dumps(msg), 0) + #print (resp.text) + #print (resp.status_code) return (resp.text, resp.status_code) -- cgit v1.2.3