celeritas
Version:
This is an API service framework which supports API requests over HTTP & WebSockets.
20 lines (17 loc) • 413 B
JavaScript
;
class ServerError extends Error {
constructor (message, http_code, app_code, properties = {}) {
super(message);
this.http_code = http_code;
if (typeof app_code == "object" && app_code.key && app_code.value) {
this.app_code = {
id: app_code.value,
name: app_code.key
};
}
else
this.app_code = app_code;
this.properties = properties;
}
}
module.exports = ServerError;