Skip to content

Commit

Permalink
Show the right HTTP method in WebDAV errors
Browse files Browse the repository at this point in the history
Could probably QI UnexpectedStatusException.channel to nsIHTTPChannel
and get requestMethod, but this is easier.
  • Loading branch information
dstillman committed Feb 23, 2017
1 parent bc940c2 commit 6329e22
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions chrome/content/zotero/xpcom/storage/webdav.js
Expand Up @@ -511,9 +511,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
}
catch (e) {
if (e instanceof Zotero.HTTP.UnexpectedStatusException) {
this._throwFriendlyError(
e.xmlhttp.method, Zotero.HTTP.getDisplayURI(propURI).spec, e.status
);
this._throwFriendlyError("DELETE", Zotero.HTTP.getDisplayURI(propURI).spec, e.status);
}
throw e;
}
Expand Down Expand Up @@ -555,9 +553,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
);
}

this._throwFriendlyError(
e.xmlhttp.method, Zotero.HTTP.getDisplayURI(uri).spec, e.status
);
this._throwFriendlyError("PUT", Zotero.HTTP.getDisplayURI(uri).spec, e.status);
}
throw e;

Expand Down Expand Up @@ -1112,9 +1108,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
}
catch (e) {
if (e instanceof Zotero.HTTP.UnexpectedStatusException) {
this._throwFriendlyError(
e.xmlhttp.method, Zotero.HTTP.getDisplayURI(uri).spec, e.status
);
this._throwFriendlyError("GET", Zotero.HTTP.getDisplayURI(uri).spec, e.status);
}
throw e;
}
Expand Down Expand Up @@ -1227,9 +1221,7 @@ Zotero.Sync.Storage.Mode.WebDAV.prototype = {
}
catch (e) {
if (e instanceof Zotero.HTTP.UnexpectedStatusException) {
this._throwFriendlyError(
e.xmlhttp.method, Zotero.HTTP.getDisplayURI(uri).spec, e.status
);
this._throwFriendlyError("PUT", Zotero.HTTP.getDisplayURI(uri).spec, e.status);
}
throw e;
}
Expand Down

0 comments on commit 6329e22

Please sign in to comment.