Created
July 7, 2023 08:24
-
-
Save krukid/773d934123761f2bf041cd47831d525b to your computer and use it in GitHub Desktop.
This file contains 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
async function main() { | |
try { | |
const t = setTimeout(() => { | |
throw new Error('Error'); | |
}, 1000); | |
await new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve(); | |
clearTimeout(t); | |
}, 1500); | |
}); | |
console.log('done'); | |
} | |
catch (err) { | |
console.log('caught', err); | |
} | |
} | |
process.on('uncaughtException', (err) => { | |
console.log('uncaught', err); | |
}); | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment