Skip to content
This repository has been archived by the owner on Jan 5, 2019. It is now read-only.

Don't silently swallow async errors #282

Merged
merged 1 commit into from
Jul 18, 2018
Merged

Conversation

lrettig
Copy link
Member

@lrettig lrettig commented Jun 5, 2018

Errors that occur during bytecode conversion were being silently swalled inside a promise

throw err
// Separately handle async promise errors here so they're not swallowed silently
console.error('Error:' + err)
process.exit(1)
})
Copy link
Member

@axic axic Jul 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, why not just remove the catch expression here so it is not caught in the first place?

What is swallowed if it is re-thrown?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error. An error thrown inside a promise catch block, without another catch/error/final block following it, is silently swallowed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Google throw in promise catch explains it.

Unfortunately it didn't offer a nicer solution.

@axic axic merged commit 5d0e54c into ewasm:master Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants