fix err not defined

Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
This commit is contained in:
Frank Jogeleit 2024-06-04 21:21:22 +02:00
parent dea4657059
commit 44816be1ea
4 changed files with 12 additions and 12 deletions

12
dist/index.js vendored
View file

@ -27378,8 +27378,8 @@ const createPersistHandler = (filePath, actions) => (response) => {
data = JSON.stringify(data) data = JSON.stringify(data)
} }
fs.writeFile(filePath, data, err => { fs.writeFile(filePath, data, error => {
if (!err) { if (!error) {
actions.info(`response persisted successfully at ${filePath}`) actions.info(`response persisted successfully at ${filePath}`)
return return
} }
@ -27454,7 +27454,7 @@ const retry = async (callback, options) => {
} }
if (i < options.retry) { if (i < options.retry) {
options.actions.warning(`#${i + 1} request failed: ${err}`); options.actions.warning(`#${i + 1} request failed: ${lastErr}`);
await sleep(options.sleep); await sleep(options.sleep);
} }
@ -27677,9 +27677,9 @@ const updateConfigForFile = (instanceConfig, filePath, actions) => {
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
const contentLength = (formData) => new Promise((resolve, reject) => { const contentLength = (formData) => new Promise((resolve, reject) => {
formData.getLength((err, length) => { formData.getLength((error, length) => {
if (err) { if (error) {
reject (err) reject(error)
return return
} }

View file

@ -17,8 +17,8 @@ const createPersistHandler = (filePath, actions) => (response) => {
data = JSON.stringify(data) data = JSON.stringify(data)
} }
fs.writeFile(filePath, data, err => { fs.writeFile(filePath, data, error => {
if (!err) { if (!error) {
actions.info(`response persisted successfully at ${filePath}`) actions.info(`response persisted successfully at ${filePath}`)
return return
} }

View file

@ -56,7 +56,7 @@ const retry = async (callback, options) => {
} }
if (i < options.retry) { if (i < options.retry) {
options.actions.warning(`#${i + 1} request failed: ${err}`); options.actions.warning(`#${i + 1} request failed: ${lastErr}`);
await sleep(options.sleep); await sleep(options.sleep);
} }

View file

@ -194,9 +194,9 @@ const updateConfigForFile = (instanceConfig, filePath, actions) => {
* @returns {Promise<number>} * @returns {Promise<number>}
*/ */
const contentLength = (formData) => new Promise((resolve, reject) => { const contentLength = (formData) => new Promise((resolve, reject) => {
formData.getLength((err, length) => { formData.getLength((error, length) => {
if (err) { if (error) {
reject (err) reject(error)
return return
} }