mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-20 08:16:40 +00:00
41 lines
744 B
JavaScript
41 lines
744 B
JavaScript
export class AjaxError extends Error {
|
|
constructor(message, err = null, code = "UNDEFINED_CODE", traceID = "N/A") {
|
|
super(message);
|
|
this.name = this.constructor.name;
|
|
this.errCode = code;
|
|
this.errOrig = err;
|
|
this.requestID = traceID;
|
|
}
|
|
|
|
code() {
|
|
return this.errCode;
|
|
}
|
|
|
|
err() {
|
|
return this.errOrig;
|
|
}
|
|
|
|
type() {
|
|
return "AjaxError";
|
|
}
|
|
|
|
traceID() {
|
|
return this.requestID;
|
|
}
|
|
}
|
|
|
|
export class ApplicationError extends Error {
|
|
constructor(message, debug) {
|
|
super(message);
|
|
this.debugMsg = debug;
|
|
}
|
|
|
|
type() {
|
|
return "ApplicationError";
|
|
}
|
|
|
|
debug() {
|
|
return this.debugMsg || "N/A";
|
|
}
|
|
}
|