1
0
Fork 0
mirror of https://github.com/fjogeleit/http-request-action.git synced 2024-12-04 21:30:23 +00:00

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)
}
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<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
}

View file

@ -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
}

View file

@ -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);
}

View file

@ -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
}