Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling #70

Open
BartBucknill opened this issue Oct 11, 2017 · 0 comments
Open

Error handling #70

BartBucknill opened this issue Oct 11, 2017 · 0 comments

Comments

@BartBucknill
Copy link
Collaborator

In multiple places (for example in verifyLogin.js) there seems to be a challenge regarding how to handle custom generated errors that we want to serve up to the client, and how to handle non-custom errors that we want to handle by serving only a generic message to the client.

Multiple .catches can cause problems as subsequent .thens get called with wrong or undefined return values (as in verifyLogin.js - bug), and later .catches may attempt to render to the client a second time, causing multiple header write errors.

In createevent.js we have addressed this problem by differentiating between custom errors and default errors based on a property present on those default errors and not on the custom errors. A more robust and readable way might be to create a custom error class, see MDN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant