extendable-http-errors
Version:
Extendable http error for node server using es2015, covers most HTTP default errors and allow extending them for custom errors.
14 lines (12 loc) • 416 B
JavaScript
const _ = require('lodash-uuid');
const ExtendableError = require('../lib/extendable-error');
module.exports = class ImATeapot extends ExtendableError {
constructor(message = "Im A Teapot", section = "ImATeapot", code = 418, data = {}){
super(message);
this.data = data;
this.code = code;
this.status = 418;
this.uuid = _.uuid();
this.section = section;
}
};