framework/js/lib/utils/RequestError.js
2015-10-21 10:47:07 +10:30

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;
}
}