Files
David Luzar e6d03b36e8 feat: add version and normalize library data (#8)
* improve router

* add `version` & normalize library data
2021-11-15 17:52:42 +05:30

17 lines
399 B
JavaScript

class RequestError extends Error {
status;
data;
toObject() {
return { name: this.name, status: this.status, message: this.message };
}
constructor({ message = "Something went wrong", status = 403, data } = {}) {
super();
this.name = "RequestError";
this.message = message;
this.status = status;
this.data = data;
}
}
module.exports.RequestError = RequestError;