You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
awaitretry(asyncbail=>{// if anything throws, we retryconstres=awaitfetch('https://google.com')// IF THIS CODE THROWS THEN THE CODE UNDERNEATH WON'T EVER RUN RIGHT?// SO WHY IS THERE LOGIC TO BAIL IN THERE, BECAUSE SURELY TO RUN THAT CODE// THE PROMISE WOULD HAVE RESOLVED CORRECTLY AND THEREFORE NOT NEED// TO BE RETRIED?if(403===res.status){// don't retry upon 403bail(newError('Unauthorized'))return}constdata=awaitres.text()returndata.substr(0,500)},{retries: 5})
my question is in caps above 😄
The text was updated successfully, but these errors were encountered:
In this example those two console logs below the await are never run
constretry=require("async-retry");functionasyncThing(){returnnewPromise((resolve,reject)=>{setTimeout(()=>{console.log("running");reject("dogs");},500);});}(async()=>{awaitretry(async()=>{constresult=awaitasyncThing();console.log(result);console.log("going and doing way more!");},{factor: 1,});})();
my question is in caps above 😄
The text was updated successfully, but these errors were encountered: