diff --git a/sections/errorhandling/useonlythebuiltinerror.md b/sections/errorhandling/useonlythebuiltinerror.md index fc1e7c7d..deb372b1 100644 --- a/sections/errorhandling/useonlythebuiltinerror.md +++ b/sections/errorhandling/useonlythebuiltinerror.md @@ -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