admin-on-rest-fr05t1k
Version:
A frontend Framework for building admin applications on top of REST services, using ES6, React and Material UI
17 lines (15 loc) • 473 B
JavaScript
class HttpError extends Error {
constructor(message, status) {
super(message);
this.message = message;
this.status = status;
this.name = this.constructor.name;
if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = (new Error(message)).stack;
}
this.stack = new Error().stack;
}
}
export default HttpError;