Skip to content

Commit 5e1d577

Browse files
Simon Grondingr2m
Simon Grondin
authored andcommitted
feat: ignore HTTP 422 errors
1 parent 8c5cd82 commit 5e1d577

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function retryPlugin (octokit, octokitOptions = {}) {
77
const state = Object.assign({
88
enabled: true,
99
retryAfterBaseValue: 1000,
10-
doNotRetry: [ 400, 401, 403, 404 ],
10+
doNotRetry: [ 400, 401, 403, 404, 422 ],
1111
retries: 3
1212
}, octokitOptions.retry)
1313

test/integration/backend-errors.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ describe('Trigger Retries', function () {
3030
expect(octokit.__requestTimings[3] - octokit.__requestTimings[2]).to.be.closeTo(450, 20)
3131
})
3232

33-
it('Should not retry 3xx/400/401/403 errors', async function () {
33+
it('Should not retry 3xx/400/401/403/422 errors', async function () {
3434
const octokit = new Octokit({ retry: { retryAfterBaseValue: 50 } })
3535
let caught = 0
36-
const testStatuses = [ 304, 400, 401, 403, 404 ]
36+
const testStatuses = [ 304, 400, 401, 403, 404, 422 ]
3737

3838
for (const status of testStatuses) {
3939
try {

0 commit comments

Comments
 (0)