-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: use node-fetch
instead of request
#1422
Conversation
/update |
scripts/fetch-asyncapi-example.js
Outdated
console.log('Fetched ZIP file'); | ||
resolve(); | ||
}).on('error', reject); | ||
fetch(SPEC_EXAMPLES_ZIP_URL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error handling can be improved by wrapping by a try/catch block (see: https://github.com/node-fetch/node-fetch?tab=readme-ov-file#handling-exceptions)
scripts/fetch-asyncapi-example.js
Outdated
} | ||
const file = fs.createWriteStream(TEMP_ZIP_NAME); | ||
res.body.pipe(file); | ||
file.on('close', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listen also the the error
event
file.on('error', (err) => {
reject(err);
});
…into request-to-fetch
Done with the changes @Amzani |
Also, currently, we are using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
node-fetch
insted of request
node-fetch
instead of request
Quality Gate passedIssues Measures |
/rtm |
🎉 This PR is included in version 1.14.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
Using
node-fetch
library instead ofrequest
since the latter is deprecated.Related issue(s)
Fixes #1421