From 1e795e6b0a0ac5f1a259ec7ff3eb431f02a5c50f Mon Sep 17 00:00:00 2001 From: Jonathan Gramain Date: Thu, 16 Oct 2025 15:52:06 -0700 Subject: [PATCH 1/2] bf: SPRXCLT-20 handle 404 error appropriately - turn error log into a debug log - remove flag 'retryable' from the returned error object, as 404 is inherently not retryable Also main request/response log messages are now more generic as they should be. --- lib/sproxyd.js | 8 ++++++-- tests/unit/sproxyd.js | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/sproxyd.js b/lib/sproxyd.js index 9dbcada..12c24e1 100644 --- a/lib/sproxyd.js +++ b/lib/sproxyd.js @@ -378,15 +378,19 @@ class SproxydClient { : contentType; const request = _createRequest(req, log, (err, response) => { if (err) { + if (err.code === 404) { + log.debug('sproxyd responded with error 404 not found'); + return callback(err); + } const errorProcessed = err; // non-streaming are always retryable; errorProcessed.retryable = true; - log.error('error sending sproxyd request', { + log.error('error during sproxyd request', { error: errorProcessed, }); return callback(errorProcessed); } - log.debug('success sending sproxyd request', { + log.debug('success of sproxyd request', { statusCode: response.statusCode, }); return callback(null, response); diff --git a/tests/unit/sproxyd.js b/tests/unit/sproxyd.js index 54fc499..e28f64c 100644 --- a/tests/unit/sproxyd.js +++ b/tests/unit/sproxyd.js @@ -259,7 +259,6 @@ const clientImmutableWithFailover = new Sproxy({ const error = new Error(); error.isExpected = true; error.code = 404; - error.retryable = true; assert.deepStrictEqual(err, error, 'Doesn\'t fail properly'); done(); From 48bfb23b45fd4936fe53eb9b50ea6f1df54854c4 Mon Sep 17 00:00:00 2001 From: Jonathan Gramain Date: Thu, 16 Oct 2025 15:54:36 -0700 Subject: [PATCH 2/2] SPRXCLT-20 bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 981b54e..30246b9 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "engines": { "node": ">=20" }, - "version": "8.1.0", + "version": "8.1.1", "description": "sproxyd client", "main": "index.js", "scripts": {