mirror of
https://github.com/excalidraw/excalidraw-libraries-server.git
synced 2026-06-16 13:34:30 +00:00
17 lines
399 B
JavaScript
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;
|