Created
September 22, 2016 16:16
-
-
Save jmar777/21ace6b8ea9b0cc428fc700faabb77e7 to your computer and use it in GitHub Desktop.
Revisions
-
jmar777 created this gist
Sep 22, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ async function example() { // you can catch rejected promises that you await on try { await Promise.reject('blargh'); } catch (err) { console.log(err); } // if you don't catch, then `example()` resolves to a rejected promise await Promise.reject('blah') } example().catch(err => console.error(err));