www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 6329e22a2056848a35663f713669098661335db5
parent bc940c296741eebcaacb80a02d2c7c6426b9b229
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 23 Feb 2017 15:21:45 -0500

Show the right HTTP method in WebDAV errors

Could probably QI UnexpectedStatusException.channel to nsIHTTPChannel
and get requestMethod, but this is easier.

Diffstat:
Mchrome/content/zotero/xpcom/storage/webdav.js | 16++++------------
1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/chrome/content/zotero/xpcom/storage/webdav.js b/chrome/content/zotero/xpcom/storage/webdav.js @@ -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; } @@ -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; @@ -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; } @@ -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; }