Conversation
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
|
🧪 Testing To try out this version of the SDK, run: Expires: Sun, 21 Sep 2025 21:09:24 GMT |
| except requests.exceptions.ConnectionError: | ||
| # Retry once on connection error | ||
| return self._session.post( | ||
| url=self._endpoint, # type: ignore[arg-type] | ||
| data=data, | ||
| timeout=timeout, | ||
| ) |
There was a problem hiding this comment.
The connection error retry logic has a potential issue - it currently retries exactly once after a ConnectionError without handling failures in the retry attempt. If the retry also fails with a ConnectionError, that exception will propagate unhandled up the call stack, potentially causing application crashes.
Consider improving this by either:
- Wrapping the retry in its own try-except block
- Letting the exception propagate to the main error handling logic
Example of a more robust approach:
try:
return self._session.post(url=self._endpoint, data=data, timeout=timeout)
except requests.exceptions.ConnectionError:
try:
# One retry attempt
return self._session.post(url=self._endpoint, data=data, timeout=timeout)
except Exception as e:
# Let the caller handle this error appropriately
raise| except requests.exceptions.ConnectionError: | |
| # Retry once on connection error | |
| return self._session.post( | |
| url=self._endpoint, # type: ignore[arg-type] | |
| data=data, | |
| timeout=timeout, | |
| ) | |
| except requests.exceptions.ConnectionError: | |
| # Retry once on connection error | |
| try: | |
| return self._session.post( | |
| url=self._endpoint, # type: ignore[arg-type] | |
| data=data, | |
| timeout=timeout, | |
| ) | |
| except Exception as e: | |
| # Let the caller handle this error appropriately | |
| raise | |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
|
🤖 Release is at https://github.com/gentrace/gentrace-python/releases/tag/v1.6.1 🌻 |
Automated Release PR
1.6.1 (2025-08-22)
Full Changelog: v1.6.0...v1.6.1
Bug Fixes
Chores
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions