mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-28 03:25:55 +08:00
Update shuttingtheprocess.md
Fix indentation for errorHandler() and add missing closing bracket.
This commit is contained in:
committed by
GitHub
parent
ecf1fe9b3d
commit
37667105fe
@ -21,13 +21,16 @@ process.on('uncaughtException', function(error) {
|
||||
// centralized error handler encapsulates error-handling related logic
|
||||
function errorHandler() {
|
||||
this.handleError = function (error) {
|
||||
return logger.logError(err).then(sendMailToAdminIfCritical).then(saveInOpsQueueIfCritical).then(determineIfOperationalError);
|
||||
return logger.logError(err)
|
||||
.then(sendMailToAdminIfCritical)
|
||||
.then(saveInOpsQueueIfCritical)
|
||||
.then(determineIfOperationalError);
|
||||
}
|
||||
|
||||
this.isTrustedError = function (error) {
|
||||
return error.isOperational;
|
||||
}
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user