diff --git a/dist/index.js b/dist/index.js index 2fd73ae..4109f5f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -27378,8 +27378,8 @@ const createPersistHandler = (filePath, actions) => (response) => { data = JSON.stringify(data) } - fs.writeFile(filePath, data, err => { - if (!err) { + fs.writeFile(filePath, data, error => { + if (!error) { actions.info(`response persisted successfully at ${filePath}`) return } @@ -27454,7 +27454,7 @@ const retry = async (callback, options) => { } if (i < options.retry) { - options.actions.warning(`#${i + 1} request failed: ${err}`); + options.actions.warning(`#${i + 1} request failed: ${lastErr}`); await sleep(options.sleep); } @@ -27677,9 +27677,9 @@ const updateConfigForFile = (instanceConfig, filePath, actions) => { * @returns {Promise} */ const contentLength = (formData) => new Promise((resolve, reject) => { - formData.getLength((err, length) => { - if (err) { - reject (err) + formData.getLength((error, length) => { + if (error) { + reject(error) return } diff --git a/src/handler/persist.js b/src/handler/persist.js index 58ffb38..043c66c 100644 --- a/src/handler/persist.js +++ b/src/handler/persist.js @@ -17,8 +17,8 @@ const createPersistHandler = (filePath, actions) => (response) => { data = JSON.stringify(data) } - fs.writeFile(filePath, data, err => { - if (!err) { + fs.writeFile(filePath, data, error => { + if (!error) { actions.info(`response persisted successfully at ${filePath}`) return } diff --git a/src/helper.js b/src/helper.js index eee4739..da3207c 100644 --- a/src/helper.js +++ b/src/helper.js @@ -56,7 +56,7 @@ const retry = async (callback, options) => { } if (i < options.retry) { - options.actions.warning(`#${i + 1} request failed: ${err}`); + options.actions.warning(`#${i + 1} request failed: ${lastErr}`); await sleep(options.sleep); } diff --git a/src/httpClient.js b/src/httpClient.js index 7dab4d7..3f397dc 100644 --- a/src/httpClient.js +++ b/src/httpClient.js @@ -194,9 +194,9 @@ const updateConfigForFile = (instanceConfig, filePath, actions) => { * @returns {Promise} */ const contentLength = (formData) => new Promise((resolve, reject) => { - formData.getLength((err, length) => { - if (err) { - reject (err) + formData.getLength((error, length) => { + if (error) { + reject(error) return }