Skip to content

Instantly share code, notes, and snippets.

View icecubed's full-sized avatar

Joel Alenchery icecubed

View GitHub Profile
@bennadel
bennadel / app-error.js
Created May 5, 2015 13:14
Creating Custom Error Objects In Node.js With Error.captureStackTrace()
// Require our core node modules.
var util = require( "util" );
// Export the constructor function.
exports.AppError = AppError;
// Export the factory function for the custom error object. The factory function lets
// the calling context create new AppError instances without calling the [new] keyword.
exports.createAppError = createAppError;