Created
August 18, 2018 16:37
-
-
Save caasi/82b746a982a99469e2f8c2a75205df53 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
function func0() { throw new Error('oops'); } | |
function func1() { return console.log('foo') || Promise.resolve('bar'); } | |
async function main() { | |
try { | |
await func0(); | |
await func1(); | |
} catch (e) { | |
console.error(e); | |
} | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如果堅持兩個 function 都一定要跑: