If you are a software engineer you must have encountered some piece of code that sometimes work and sometimes doesnot.
Why do you need Retry
Well, you failed. But don't you worry, You have lot of retries left but it;s good to know what made you fail so you are prepared for it. Even in software word where everything is perdefined, there are lot of factors we can not control. There are sveral reasons a piece of code could fail.
- Network Failures
- Third Party Failures.
- Database opereation failures.
Retry Using Loops
A simple way of retrying is that having the operation in a loop for n times and it comes out of the loop if it is successfull or we can return the error in case if it is not successful
Top comments (0)