Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const shouldReturnPromise = () => { throw "test"; }
- const withAsyncAwait = async () => {
- try {
- await shouldReturnPromise()
- } catch (e) {
- console.log('Handled: ' + e)
- }
- }
- const withPromise = async () => {
- shouldReturnPromise().then(null, () => console.log('Not Handled!'));
- }
- console.log(withAsyncAwait());
- console.log(withPromise());
Add Comment
Please, Sign In to add comment