Skip to content

Commit ac0791d

Browse files
author
Sebastian Molenda
committed
fixed threads and error handling
1 parent b4ab9cf commit ac0791d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pubnub/request_handlers/httpx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _build_envelope(self, p_options, e_options):
136136
try:
137137
res = self._invoke_request(p_options, e_options, url_base_path)
138138
except PubNubException as e:
139-
if e._pn_error is PNERR_CONNECTION_ERROR:
139+
if e._pn_error in [PNERR_CONNECTION_ERROR, PNERR_UNKNOWN_ERROR]:
140140
status_category = PNStatusCategory.PNUnexpectedDisconnectCategory
141141
elif e._pn_error is PNERR_CLIENT_TIMEOUT:
142142
status_category = PNStatusCategory.PNTimeoutCategory

pubnub/request_handlers/requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _build_envelope(self, p_options, e_options):
143143
try:
144144
res = self._invoke_request(p_options, e_options, url_base_path)
145145
except PubNubException as e:
146-
if e._pn_error is PNERR_CONNECTION_ERROR:
146+
if e._pn_error in [PNERR_CONNECTION_ERROR, PNERR_UNKNOWN_ERROR]:
147147
status_category = PNStatusCategory.PNUnexpectedDisconnectCategory
148148
elif e._pn_error is PNERR_CLIENT_TIMEOUT:
149149
status_category = PNStatusCategory.PNTimeoutCategory

0 commit comments

Comments
 (0)