diff --git a/ldclient/impl/datasource/polling.py b/ldclient/impl/datasource/polling.py index 95d4d3ff..68f61ebc 100644 --- a/ldclient/impl/datasource/polling.py +++ b/ldclient/impl/datasource/polling.py @@ -38,8 +38,11 @@ def _poll(self): log.info("PollingUpdateProcessor initialized ok") self._ready.set() except UnsuccessfulResponseException as e: - log.error(http_error_message(e.status, "polling request")) - if not is_http_error_recoverable(e.status): + http_error_message_result = http_error_message(e.status, "polling request") + if is_http_error_recoverable(e.status): + log.warning(http_error_message_result) + else: + log.error(http_error_message_result) self._ready.set() # if client is initializing, make it stop waiting; has no effect if already inited self.stop() except Exception as e: diff --git a/ldclient/impl/datasource/streaming.py b/ldclient/impl/datasource/streaming.py index 3dbef2ff..052e7744 100644 --- a/ldclient/impl/datasource/streaming.py +++ b/ldclient/impl/datasource/streaming.py @@ -83,10 +83,14 @@ def run(self): log.info("StreamingUpdateProcessor initialized ok.") self._ready.set() except UnsuccessfulResponseException as e: - log.error(http_error_message(e.status, "stream connection")) self._record_stream_init(True) self._es_started = None - if not is_http_error_recoverable(e.status): + + http_error_message_result = http_error_message(e.status, "stream connection") + if is_http_error_recoverable(e.status): + log.warning(http_error_message_result) + else: + log.error(http_error_message_result) self._ready.set() # if client is initializing, make it stop waiting; has no effect if already inited self.stop() break