-
-
Save kepta/9f9071c49b8e510d80dc9aacdf4aa5ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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