Created
February 23, 2016 01:40
-
-
Save rt2zz/f526ef7165e7ec1fa0e5 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
try { | |
let data = await getSomeData() | |
processData(data) | |
// ... do more stuff | |
} catch (err) { | |
// handle bad data or exception | |
} |
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
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