-
-
Save Darkle/bf880cbd8ba5fd8aaaa3ba94c4df673e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| fetch('/foo') | |
| .then(raiseErrorOnBadResponse) | |
| .catch(logError) | |
| // or maybe i could wrap fetch and throw an error when not a 200 response | |
| netReq('/foo') | |
| .catch(logErrror) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Possible alternative: https://github.com/sindresorhus/ky-universal
For node only: https://github.com/sindresorhus/got