
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
error-retry
Advanced tools
Easy error handling for async functions or any function that returns a promise. Errors are retried with an exponential backoff delay between each attempt.
$ npm install error-retry
var { retry, setMaxRetries } = require('error-retry');
// Example function that just throws errors until called four times.
var exampleCount = 0;
async function example(param1, param2) {
++exampleCount
console.log(`example() called param1: ${param1} param2: ${param2} try: ${exampleCount}`)
if (exampleCount < 4) {
throw Error('example failure')
}
return 'example success!'
}
(async function() {
try {
// Call example() with error retry handling
var result = await retry(() => example('abc', 123))
console.log(`result = ${result}`)
}
catch (ex) {
console.log(`ex = ${ex}`)
}
}())
The default number of retries is 3. To modify this value call:
setMaxRetries(5)
MIT license; see LICENSE.
FAQs
Error retries for async functions or functions that return a promise
The npm package error-retry receives a total of 1 weekly downloads. As such, error-retry popularity was classified as not popular.
We found that error-retry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.