Skip to content

Commit bc1ff33

Browse files
Merge pull request #377 from contentstack/fix/dx-5444-und-err-socket-422-errors
fix: Handle connection drops (UND_ERR_SOCKET) and prevent process crash
2 parents 3e93542 + 0434d1b commit bc1ff33

File tree

5 files changed

+660
-700
lines changed

5 files changed

+660
-700
lines changed

.github/workflows/sca-scan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ jobs:
1313
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
1414
with:
1515
args: --all-projects --fail-on=all
16+
json: true
17+
continue-on-error: true
18+
- uses: contentstack/sca-policy@main

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
## Change log
2+
3+
### Version: 3.27.0
4+
#### Date: Mar-23-2026
5+
##### Fix:
6+
- Handle connection drops and socket closures so they no longer cause unhandled rejections and process crashes. The SDK now:
7+
- Catches body-read failures by adding `.catch()` on the `response.json()` promise in both 200 and non-200 response branches.
8+
- Applies the same catch-and-retry behavior for fetch-level rejections (e.g. connection closed before or during response).
9+
- Rejects the Request promise with the actual error when retries are exhausted, so callers can handle or log failures without the Node process crashing.
10+
211
### Version: 3.26.4
312
#### Date: Jan-27-2026
413
##### Feat:

0 commit comments

Comments
 (0)