Skip to content

Instantly share code, notes, and snippets.

@HenriqueSilverio
Created April 23, 2020 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HenriqueSilverio/50dbaa2e720d3f022c853aeb5e205198 to your computer and use it in GitHub Desktop.
Save HenriqueSilverio/50dbaa2e720d3f022c853aeb5e205198 to your computer and use it in GitHub Desktop.
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