Skip to content

Instantly share code, notes, and snippets.

@kepta

kepta/block21.js Secret

Last active February 21, 2018 15:08
Show Gist options
  • Save kepta/9f9071c49b8e510d80dc9aacdf4aa5ba to your computer and use it in GitHub Desktop.
Save kepta/9f9071c49b8e510d80dc9aacdf4aa5ba to your computer and use it in GitHub Desktop.
request(opts)
.catch(err => {
if (err.statusCode === 400) {
return request(opts)
.then(r => r.text())
.catch(err2 => console.error(err2))
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment