Skip to content

Instantly share code, notes, and snippets.

@oieduardorabelo
Created April 15, 2017 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oieduardorabelo/d16a58d39248f55d1159b99d0b521e17 to your computer and use it in GitHub Desktop.
Save oieduardorabelo/d16a58d39248f55d1159b99d0b521e17 to your computer and use it in GitHub Desktop.
const superagent = require('superagent');
const NUM_RETRIES = 3;
test();
async function test() {
let arr = new Array(NUM_RETRIES).map(() => null);
arr.forEach(() => {
try {
// SyntaxError: Unexpected identifier. This `await` is not in an async function!
await superagent.get('http://google.com/this-throws-an-error');
} catch(err) {}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment