Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //..
- operation.attempt(function(currentAttempt) {
- // Make an HTTP GET request to http://httpbin.io/status/500
- axios.get(URL)
- .then((response) => {
- // If the request is successful, resolve the Promise with the response body
- cb(null, response.data);
- })
- .catch((error) => {
- // If there's an error, check if retry is allowed.
- if (operation.retry(error)) {
- return;
- }
- // If all retry attempts are exhausted, reject with the main error
- cb(operation.mainError());
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement