Feature Request: Retry on Error
See original GitHub issueFor example,
async function main (): Promise<void> {
await new Listr([
{
task: (ctx, task) => { // line #4
return (
execa.command(`xyz -y`)
.then(()=> // do something)
.catch((err: any) => {
// e.g. the user doesn't have `xyz` installed or accessible
if (err.code === 'ENOENT') {
npm install xyz // <---- address specific error
task.retry(1) // <---- rerun the current task, e.g. the
// task starting on line 4 of this
// example;
// to avoid infinite loops, pass a
// maximum number of retries, e.g. `1`;
// should probably default to `1`
}
}))
}
], {}
).run()
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Retry failed requests - elmah.io Blog
Retry failed request lets you check if a failing endpoint has been fixed ... The Retry Request feature is available when expanding an...
Read more >Add Retries to HTTP requests - DEV Community
To fix this, you can improve your HTTP request library by adding intelligent retry functionality. This kind of remediation is crucial to ...
Read more >Request retry | Citrix ADC 13.1 - Citrix Product Documentation
The request retry addresses connection failure scenarios and enables the appliance to choose the next available service and forward the request.
Read more >Retry-On-Fail Loop Feature Request - KNIME Forum
My first attempt resulted in an error "Can't merge FlowVariable Stacks! (likely a loop problem)" at the downstream Database Writer node. It ...
Read more >Adding Automatic Retries to Fetch - Mark Michon
One missing feature that can come in handy when making requests is the ability to ... implicit return to return a fetch that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Good to know that the strict null checks may show up as undefined initially. 👍
The other type errors were showing up in my IDE (VS Code) because I hadn’t enabled the TypeScript extension (TypeScript Hero). 😳
Yeah with scrict null checks that is possible because that item is initially undefined.