Skip to content

Commit a96f3ce

Browse files
authored
FFM-7880 Improve SSE Client error logging (#64)
* FFM-7880 Improve SSE Client error logging * FFM-7880 1.1.12 release prep * FFM-7880 Lint
1 parent b6fc1d4 commit a96f3ce

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

featureflags/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = """Enver Bisevac"""
44
__email__ = "[email protected]"
5-
__version__ = '1.1.11'
5+
__version__ = '1.1.12'

featureflags/sse_client.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,18 @@ def __next__(self):
109109
self.buf += self.decoder.decode(next_chunk)
110110

111111
except (StopIteration, requests.RequestException, EOFError) as e:
112-
log.error(e)
112+
if isinstance(e, StopIteration):
113+
log.error("Error when iterating through stream messages, "
114+
"attempting to resume")
115+
116+
if isinstance(e, EOFError):
117+
log.error("Received unexpected EOF from stream, "
118+
"attempting to reconnect")
119+
120+
if isinstance(e, requests.RequestException):
121+
log.error("Error encountered in stream, "
122+
"attempting to reconnect: %s", e)
123+
113124
time.sleep(self.retry / 1000.0)
114125
self._connect()
115126

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.1.11
2+
current_version = 1.1.12
33
commit = True
44
tag = True
55

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
test_suite="tests",
5757
tests_require=test_requirements,
5858
url="https://github.com/harness/ff-python-server-sdk",
59-
version='1.1.11',
59+
version='1.1.12',
6060
zip_safe=False,
6161
)

0 commit comments

Comments
 (0)