Fix typo discpline to discipline

This commit is contained in:
Paulo Vítor S Reis
2017-11-15 13:03:17 -03:00
committed by GitHub
parent 016c0b44a0
commit d1be68e089

View File

@ -4,7 +4,7 @@
### One Paragraph Explainer
Typically, most of modern Node.JS/Express application code runs within promises whether within the .then handler, a function callback or in a catch block. Suprisingly, unless a developer remembered to add a .catch clause, errors thrown at these places disappear, even not by app.uncaughtException. Recent versions of Node added a warning message when an unhandled rejection pops, though this might help to notice when things go wrong but it's obviously not a proper error handling. The straightforward solution is to never forget adding .catch clause within each promise chain call and redirect to a centralized error handler. However building your error handling strategy only on developers discpline is somewhat fragile. Consequently, its highly recommended using a graceful fallback and subscribe to process.on(unhandledRejection, callback) this will ensure that any promise error, if not handled locally, will get its treatment.
Typically, most of modern Node.JS/Express application code runs within promises whether within the .then handler, a function callback or in a catch block. Suprisingly, unless a developer remembered to add a .catch clause, errors thrown at these places disappear, even not by app.uncaughtException. Recent versions of Node added a warning message when an unhandled rejection pops, though this might help to notice when things go wrong but it's obviously not a proper error handling. The straightforward solution is to never forget adding .catch clause within each promise chain call and redirect to a centralized error handler. However building your error handling strategy only on developers discipline is somewhat fragile. Consequently, its highly recommended using a graceful fallback and subscribe to process.on(unhandledRejection, callback) this will ensure that any promise error, if not handled locally, will get its treatment.
<br/><br/>