traxxx-web/src/errors.js

17 lines
288 B
JavaScript
Raw Normal View History

export class HttpError extends Error {
constructor(message, httpCode, friendlyMessage, data) {
super(message);
this.name = 'HttpError';
this.httpCode = httpCode;
if (friendlyMessage) {
this.friendlyMessage = friendlyMessage;
}
if (data) {
this.data = data;
}
}
}