Skip to content

Instantly share code, notes, and snippets.

@Darkle
Created March 7, 2019 21:24
Show Gist options
  • Select an option

  • Save Darkle/bf880cbd8ba5fd8aaaa3ba94c4df673e to your computer and use it in GitHub Desktop.

Select an option

Save Darkle/bf880cbd8ba5fd8aaaa3ba94c4df673e to your computer and use it in GitHub Desktop.
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)
@Darkle
Copy link
Author

Darkle commented Mar 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment