Show UnexpectedStatusException response without prefix during sync

This commit is contained in:
Dan Stillman 2017-04-07 22:45:16 -04:00
parent a64c6808e5
commit 64414e49be

View file

@ -566,7 +566,7 @@ Zotero.Sync.Runner_Module = function (options = {}) {
throw e;
}
Zotero.debug("Sync failed for library " + libraryID);
Zotero.debug("Sync failed for library " + libraryID, 1);
Zotero.logError(e);
this.checkError(e);
options.onError(e);
@ -1217,8 +1217,13 @@ Zotero.Sync.Runner_Module = function (options = {}) {
}
// For unexpected ones, just show a generic message
else {
// TODO: improve and localize
var msg = "An error occurred during syncing:\n\n" + e.message;
if (e instanceof Zotero.HTTP.UnexpectedStatusException) {
msg = Zotero.Utilities.ellipsize(e.xmlhttp.responseText, 1000, true);
}
else {
// TODO: Localize
var msg = "An error occurred during syncing:\n\n" + e.message;
}
}
var desc = doc.createElement('description');