You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: