Skip to content

Commit

Permalink
fix err not defined
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <[email protected]>
  • Loading branch information
Frank Jogeleit committed Jun 4, 2024
1 parent dea4657 commit 44816be
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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);
}

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

Expand Down
4 changes: 2 additions & 2 deletions src/handler/persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 3 additions & 3 deletions src/httpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ const updateConfigForFile = (instanceConfig, filePath, actions) => {
* @returns {Promise<number>}
*/
const contentLength = (formData) => new Promise((resolve, reject) => {
formData.getLength((err, length) => {
if (err) {
reject (err)
formData.getLength((error, length) => {
if (error) {
reject(error)
return
}

Expand Down

0 comments on commit 44816be

Please sign in to comment.