Skip to content

Fix for is_error #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pubnub/models/consumer/common.py
Original file line number Diff line number Diff line change
@@ -20,4 +20,4 @@ def __init__(self):
self.affected_groups = None

def is_error(self):
return self.error is not None
return True if self.error else False
2 changes: 1 addition & 1 deletion pubnub/pubnub.py
Original file line number Diff line number Diff line change
@@ -216,7 +216,7 @@ def _perform_heartbeat_loop(self):

def heartbeat_callback(raw_result, status):
heartbeat_verbosity = self._pubnub.config.heartbeat_notification_options
if status.is_error:
if status.is_error():
if heartbeat_verbosity in (PNHeartbeatNotificationOptions.ALL, PNHeartbeatNotificationOptions.FAILURES):
self._listener_manager.announce_status(status)
else:
2 changes: 1 addition & 1 deletion pubnub/pubnub_asyncio.py
Original file line number Diff line number Diff line change
@@ -503,7 +503,7 @@ async def _perform_heartbeat_loop(self):
envelope = await heartbeat_call

heartbeat_verbosity = self._pubnub.config.heartbeat_notification_options
if envelope.status.is_error:
if envelope.status.is_error():
if heartbeat_verbosity in (PNHeartbeatNotificationOptions.ALL, PNHeartbeatNotificationOptions.FAILURES):
self._listener_manager.announce_status(envelope.status)
else: