Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax. I've tried to make it as lean and unobtrusive as possible. Defining our own base class for errors errors/AppError.js