mirror of
https://github.com/fjogeleit/http-request-action.git
synced 2024-11-25 05:10:57 -05:00
Merge pull request #143 from fjogeleit/fixes
fix retry and ignore status response
This commit is contained in:
commit
2bb8059d00
3 changed files with 8 additions and 8 deletions
4
dist/index.js
vendored
4
dist/index.js
vendored
|
@ -27232,7 +27232,7 @@ const retry = async (callback, options) => {
|
|||
lastErr = err;
|
||||
}
|
||||
|
||||
if (i < options.retries) {
|
||||
if (i < options.retry) {
|
||||
options.actions.warning(`#${i + 1} request failed: ${err}`);
|
||||
await sleep(options.sleep);
|
||||
}
|
||||
|
@ -27357,7 +27357,7 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti
|
|||
if (error.response && options.ignoredCodes.includes(error.response.status)) {
|
||||
actions.warning(`ignored status code: ${JSON.stringify({ code: error.response.status, message: error.response.data })}`)
|
||||
|
||||
return null
|
||||
return error.response
|
||||
}
|
||||
|
||||
if (!error.response && error.request && options.preventFailureOnNoResponse) {
|
||||
|
|
|
@ -55,7 +55,7 @@ const retry = async (callback, options) => {
|
|||
lastErr = err;
|
||||
}
|
||||
|
||||
if (i < options.retries) {
|
||||
if (i < options.retry) {
|
||||
options.actions.warning(`#${i + 1} request failed: ${err}`);
|
||||
await sleep(options.sleep);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti
|
|||
if (error.response && options.ignoredCodes.includes(error.response.status)) {
|
||||
actions.warning(`ignored status code: ${JSON.stringify({ code: error.response.status, message: error.response.data })}`)
|
||||
|
||||
return null
|
||||
return error.response
|
||||
}
|
||||
|
||||
if (!error.response && error.request && options.preventFailureOnNoResponse) {
|
||||
|
|
Loading…
Reference in a new issue