Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 52c9434

Browse files
authored
Merge pull request #35 from kevinsteves/event-xpoll
ack/nack now return no content on success.
2 parents 9c51b56 + 9f127c4 commit 52c9434

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pancloud/event.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,12 @@ def xpoll(self, channel_id=None, data=None, ack=False,
226226
"""
227227
def _ack(channel_id, **kwargs):
228228
r = self.ack(channel_id, **kwargs)
229-
try:
230-
r_json = r.json()
231-
except ValueError as e:
232-
raise PanCloudError('Invalid JSON: %s' % e)
233229

234230
if not (200 <= r.status_code < 300):
231+
try:
232+
r_json = r.json()
233+
except ValueError as e:
234+
raise PanCloudError('Invalid JSON: %s' % e)
235235
if 'errorCode' in r_json and 'errorMessage' in r_json:
236236
raise PanCloudError('%s: %s' %
237237
(r_json['errorCode'],

0 commit comments

Comments
 (0)