Make Zotero.HTTP exceptions instances of Error

This commit is contained in:
Dan Stillman 2015-06-07 15:27:23 -04:00
parent 16706ba481
commit 53706d633a

View file

@ -32,7 +32,7 @@ Zotero.HTTP = new function() {
Zotero.debug(e, 1);
}
};
this.UnexpectedStatusException.prototype = Object.create(Error.prototype);
this.UnexpectedStatusException.prototype.toString = function() {
return this.message;
};
@ -44,6 +44,7 @@ Zotero.HTTP = new function() {
this.BrowserOfflineException = function() {
this.message = "XMLHttpRequest could not complete because the browser is offline";
};
this.BrowserOfflineException.prototype = Object.create(Error.prototype);
this.BrowserOfflineException.prototype.toString = function() {
return this.message;
};