@podium/client
Advanced tools
Comparing version 5.2.0-next.1 to 5.2.0-next.2
@@ -0,1 +1,8 @@ | ||
# [5.2.0-next.2](https://github.com/podium-lib/client/compare/v5.2.0-next.1...v5.2.0-next.2) (2024-09-16) | ||
### Bug Fixes | ||
* improve error messages when fetching from manifest, content and fallback routes when a timeout occurs ([e188bbc](https://github.com/podium-lib/client/commit/e188bbc40d30ed2e21947dd29de76bd218907428)) | ||
# [5.2.0-next.1](https://github.com/podium-lib/client/compare/v5.1.10-next.2...v5.2.0-next.1) (2024-09-10) | ||
@@ -2,0 +9,0 @@ |
@@ -301,14 +301,10 @@ import { pipeline } from 'stream'; | ||
// Network error | ||
if (outgoing.throwable) { | ||
timer({ | ||
labels: { | ||
status: 'failure', | ||
}, | ||
}); | ||
if (error.name === 'AbortError') { | ||
this.#log.warn( | ||
`request to remote resource for content was aborted due to the resource failing to respond before the configured timeout (${outgoing.timeout}ms) - resource: ${outgoing.name} - url: ${uri}`, | ||
); | ||
} else { | ||
this.#log.warn( | ||
`could not create network connection to remote resource when trying to request content - resource: ${outgoing.name} - url: ${uri}`, | ||
); | ||
throw badGateway(`Error reading content at ${uri}`, error); | ||
} | ||
@@ -322,5 +318,6 @@ | ||
this.#log.warn( | ||
`could not create network connection to remote resource when trying to request content - resource: ${outgoing.name} - url: ${uri}`, | ||
); | ||
// Network error | ||
if (outgoing.throwable) { | ||
throw badGateway(`Error reading content at ${uri}`, error); | ||
} | ||
@@ -327,0 +324,0 @@ outgoing.success = true; |
@@ -184,3 +184,2 @@ import abslog from 'abslog'; | ||
return outgoing; | ||
// eslint-disable-next-line no-unused-vars | ||
} catch (error) { | ||
@@ -193,5 +192,11 @@ timer({ | ||
this.#log.warn( | ||
`could not create network connection to remote resource for fallback content - resource: ${outgoing.name} - url: ${outgoing.fallbackUri}`, | ||
); | ||
if (error.name === 'AbortError') { | ||
this.#log.warn( | ||
`request to read fallback was aborted due to the resource failing to respond before the configured timeout (${outgoing.timeout}ms) - resource: ${outgoing.name} - url: ${outgoing.fallbackUri}`, | ||
); | ||
} else { | ||
this.#log.warn( | ||
`could not create network connection to remote resource for fallback - resource: ${outgoing.name} - url: ${outgoing.fallbackUri}`, | ||
); | ||
} | ||
@@ -198,0 +203,0 @@ outgoing.fallback = ''; |
@@ -249,3 +249,2 @@ import CachePolicy from 'http-cache-semantics'; | ||
return outgoing; | ||
// eslint-disable-next-line no-unused-vars | ||
} catch (error) { | ||
@@ -258,5 +257,11 @@ timer({ | ||
this.#log.warn( | ||
`could not create network connection to remote manifest - resource: ${outgoing.name} - url: ${outgoing.manifestUri}`, | ||
); | ||
if (error.name === 'AbortError') { | ||
this.#log.warn( | ||
`request to remote manifest was aborted due to the resource failing to respond before the configured timeout (${outgoing.timeout}ms) - resource: ${outgoing.name} - url: ${outgoing.manifestUri}`, | ||
); | ||
} else { | ||
this.#log.warn( | ||
`could not create network connection to remote manifest - resource: ${outgoing.name} - url: ${outgoing.manifestUri}`, | ||
); | ||
} | ||
return outgoing; | ||
@@ -263,0 +268,0 @@ } |
{ | ||
"name": "@podium/client", | ||
"version": "5.2.0-next.1", | ||
"version": "5.2.0-next.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
178560
2619