Skip to content

Instantly share code, notes, and snippets.

@rt2zz
Created February 23, 2016 01:40
Show Gist options
  • Save rt2zz/f526ef7165e7ec1fa0e5 to your computer and use it in GitHub Desktop.
Save rt2zz/f526ef7165e7ec1fa0e5 to your computer and use it in GitHub Desktop.
try {
let data = await getSomeData()
processData(data)
// ... do more stuff
} catch (err) {
// handle bad data or exception
}
try {
let data = await getSomeData()
if (data.status >= 300) {
// handle bad data
} else {
processData(data)
}
// ... do more stuff
} catch (err) {
// handle exception
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment