diff --git a/lib/index.js b/lib/index.js index 903877f7..28bd89f9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -7,7 +7,7 @@ function retryPlugin (octokit, octokitOptions = {}) { const state = Object.assign({ enabled: true, retryAfterBaseValue: 1000, - doNotRetry: [ 400, 401, 403, 404 ], + doNotRetry: [ 400, 401, 403, 404, 422 ], retries: 3 }, octokitOptions.retry) diff --git a/test/integration/backend-errors.js b/test/integration/backend-errors.js index 0f319f19..12ae482e 100644 --- a/test/integration/backend-errors.js +++ b/test/integration/backend-errors.js @@ -30,10 +30,10 @@ describe('Trigger Retries', function () { expect(octokit.__requestTimings[3] - octokit.__requestTimings[2]).to.be.closeTo(450, 20) }) - it('Should not retry 3xx/400/401/403 errors', async function () { + it('Should not retry 3xx/400/401/403/422 errors', async function () { const octokit = new Octokit({ retry: { retryAfterBaseValue: 50 } }) let caught = 0 - const testStatuses = [ 304, 400, 401, 403, 404 ] + const testStatuses = [ 304, 400, 401, 403, 404, 422 ] for (const status of testStatuses) { try {