Created
April 23, 2020 23:19
-
-
Save HenriqueSilverio/50dbaa2e720d3f022c853aeb5e205198 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
const start = async () => { | |
try { | |
throw new Error('Failed to start!') | |
} catch (err) { | |
await somethingThrows() | |
} | |
} | |
start() | |
.catch(err => { | |
// Se deu erro no start e o primeiro catch falhou por algum motivo... | |
// Encerra aqui de forma síncrona... | |
console.error('Some unhandled error happened!') | |
console.error(err.stack) | |
proccess.exit(1) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment