sensai
Version:
Because even AI needs a master
24 lines (23 loc) • 681 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return ServerError;
}
});
class ServerError extends Error {
//date: Date
constructor(code = 500, ...params){
super(...params);
// Maintains proper stack trace for where our error was thrown
if (Error.captureStackTrace) {
Error.captureStackTrace(this, ServerError);
}
this.name = "ServerError";
this.code = code; // TODO should we call `code`, `status` instead and reserve code as an identifier?
//this.date = new Date()
}
}