diff --git a/CHANGELOG.MD b/CHANGELOG.MD index 45de6798..228ee690 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - drop Node.js 14 support from build and readme - bump `@emurgo/cardano-serialization-lib-nodejs` and dev deps -- enabled retry logic for requests failing on `EPROTO` error +- enabled retry logic for requests failing on `EPROTO` error and `520` status code ### Fixed diff --git a/src/utils/index.ts b/src/utils/index.ts index d6d6a070..426c4527 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -65,7 +65,7 @@ export const validateOptions = (options?: Options): ValidatedOptions => { retrySettings: options.retrySettings ?? { limit: 3, // retry count methods: ['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE'], // no retry on POST - statusCodes: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], + statusCodes: [408, 413, 429, 500, 502, 503, 504, 520, 521, 522, 524], errorCodes: [ 'ETIMEDOUT', 'ECONNRESET', diff --git a/test/tests/utils/utils.ts b/test/tests/utils/utils.ts index 7918f019..57b8f612 100644 --- a/test/tests/utils/utils.ts +++ b/test/tests/utils/utils.ts @@ -150,7 +150,7 @@ describe('utils', () => { retrySettings: { limit: 3, methods: ['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE'], - statusCodes: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], + statusCodes: [408, 413, 429, 500, 502, 503, 504, 520, 521, 522, 524], errorCodes: [ 'ETIMEDOUT', 'ECONNRESET',