mirror of
https://github.com/fjogeleit/http-request-action.git
synced 2026-02-05 00:55:52 +08:00
fix err not defined
Signed-off-by: Frank Jogeleit <frank.jogeleit@lovoo.com>
This commit is contained in:
12
dist/index.js
vendored
12
dist/index.js
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user