diff --git a/dist/index.js b/dist/index.js index b9d75c5..93f46d3 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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); } @@ -27356,10 +27356,10 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti } catch(error) { 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) { actions.warning(`no response received: ${JSON.stringify(error)}`); diff --git a/src/helper.js b/src/helper.js index 5144de2..eee4739 100644 --- a/src/helper.js +++ b/src/helper.js @@ -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); } diff --git a/src/httpClient.js b/src/httpClient.js index a384689..7dab4d7 100644 --- a/src/httpClient.js +++ b/src/httpClient.js @@ -94,10 +94,10 @@ const request = async({ method, instanceConfig, data, files, file, actions, opti } catch(error) { 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) { actions.warning(`no response received: ${JSON.stringify(error)}`);