mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-11-03 03:36:26 +08:00
Merge pull request #6 from kevinrambaud/master
Fix incomplete function declaration for appError
This commit is contained in:
@ -42,13 +42,15 @@ if(!productToAdd)
|
||||
|
||||
```javascript
|
||||
//centralized error object that derives from Node’s Error
|
||||
function name, httpCode, description, isOperational) {
|
||||
function appError(name, httpCode, description, isOperational) {
|
||||
Error.call(this);
|
||||
Error.captureStackTrace(this);
|
||||
this.name = name;
|
||||
//...other properties assigned here
|
||||
};
|
||||
|
||||
appError.prototype.__proto__ = Error.prototype;
|
||||
|
||||
module.exports.appError = appError;
|
||||
|
||||
//client throwing an exception
|
||||
|
||||
Reference in New Issue
Block a user