question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Retry on Error

See original GitHub issue

For 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:closed
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
metaseancommented, Mar 8, 2021

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). 😳

1reaction
cenk1cenk2commented, Mar 8, 2021

Yeah with scrict null checks that is possible because that item is initially undefined.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found