mirror of
https://github.com/fjogeleit/http-request-action.git
synced 2024-11-24 04:41:08 -05:00
fix err not defined
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
This commit is contained in:
parent
dea4657059
commit
44816be1ea
4 changed files with 12 additions and 12 deletions
12
dist/index.js
vendored
12
dist/index.js
vendored
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue