Last active
July 28, 2017 09:06
-
-
Save gskachkov/6f2b875cd97a771e4333f99a9cdaf3f3 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
var asyncThrow = async () => { throw new Error('Rejected-value') }; | |
var reject = async () => Promise.reject('Rejected-value'); | |
var foo = async () => { | |
try { | |
await asyncThrow(); | |
} catch (e) { | |
console.log('Catched error:', e); | |
} | |
try { | |
await reject(); | |
} catch (e) { | |
console.log('Catched error:', e); | |
} | |
}; | |
foo(); | |
// Catched error: Error: Rejected-value | |
// .... | |
// Catched error:Rejected-value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment