diff --git a/README.md b/README.md index d1abca5..2c3a519 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # plugin-retry.js -> Retries requests for server 4xx/5xx responses except `400`, `401`, `403`, `404`, and `422`. +> Retries requests for server 4xx/5xx responses except `400`, `401`, `403`, `404`, `422`, and `451`. [![@latest](https://img.shields.io/npm/v/@octokit/plugin-retry.svg)](https://www.npmjs.com/package/@octokit/plugin-retry) [![Build Status](https://github.com/octokit/plugin-retry.js/workflows/Test/badge.svg)](https://github.com/octokit/plugin-retry.js/actions?workflow=Test) diff --git a/src/index.ts b/src/index.ts index eae8e01..d1b96cf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,7 @@ export function retry(octokit: Octokit, octokitOptions: any) { { enabled: true, retryAfterBaseValue: 1000, - doNotRetry: [400, 401, 403, 404, 422], + doNotRetry: [400, 401, 403, 404, 422, 451], retries: 3, }, octokitOptions.retry diff --git a/test/retry.test.ts b/test/retry.test.ts index 8365de7..eb94af9 100644 --- a/test/retry.test.ts +++ b/test/retry.test.ts @@ -205,10 +205,10 @@ describe("Automatic Retries", function () { expect(ms2).toBeGreaterThan(420); }); - it("Should not retry 3xx/400/401/403/422 errors", async function () { + it("Should not retry 3xx/400/401/403/422/451 errors", async function () { const octokit = new TestOctokit({ retry: { retryAfterBaseValue: 50 } }); let caught = 0; - const testStatuses = [304, 400, 401, 403, 404, 422]; + const testStatuses = [304, 400, 401, 403, 404, 422, 451]; for (const status of testStatuses) { try { @@ -241,7 +241,7 @@ describe("Automatic Retries", function () { }, }); let caught = 0; - const testStatuses = [304, 400, 401, 403, 404]; + const testStatuses = [304, 400, 401, 403, 404, 422, 451]; for (const status of testStatuses) { try {