framework/js/old/common/utils/RequestError.js
2020-04-18 09:02:49 -04:00

17 lines
341 B
JavaScript

export default class RequestError {
constructor(status, responseText, options, xhr) {
this.status = status;
this.responseText = responseText;
this.options = options;
this.xhr = xhr;
try {
this.response = JSON.parse(responseText);
} catch (e) {
this.response = null;
}
this.alert = null;
}
}