Don't show error icon when file sync is cancelled
This commit is contained in:
parent
42d570e623
commit
b4121ee6bc
3 changed files with 19 additions and 6 deletions
|
@ -229,8 +229,13 @@ Zotero.Sync.Storage.Engine.prototype.start = Zotero.Promise.coroutine(function*
|
||||||
succeeded++;
|
succeeded++;
|
||||||
}
|
}
|
||||||
else if (!p.isPending()) {
|
else if (!p.isPending()) {
|
||||||
|
let e = p.reason();
|
||||||
|
if (e instanceof Zotero.HTTP.CancelledException) {
|
||||||
|
Zotero.debug(`File ${type} sync cancelled for ${this.library.name} `
|
||||||
|
+ `(${succeeded} succeeded, ${failed} failed)`);
|
||||||
|
throw new Zotero.Sync.UserCancelledException();
|
||||||
|
}
|
||||||
if (this.stopOnError) {
|
if (this.stopOnError) {
|
||||||
let e = p.reason();
|
|
||||||
Zotero.debug(`File ${type} sync failed for ${this.library.name}`);
|
Zotero.debug(`File ${type} sync failed for ${this.library.name}`);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
|
@ -751,11 +751,14 @@ Zotero.Sync.Storage.Mode.ZFS.prototype = {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
let msg = `Unexpected file registration status ${e.status} (${item.libraryKey})`;
|
if (e instanceof Zotero.HTTP.UnexpectedStatusException) {
|
||||||
Zotero.logError(msg);
|
let msg = `Unexpected file registration status ${e.status} (${item.libraryKey})`;
|
||||||
Zotero.logError(e.xmlhttp.responseText);
|
Zotero.logError(msg);
|
||||||
Zotero.debug(e.xmlhttp.getAllResponseHeaders());
|
Zotero.logError(e.xmlhttp.responseText);
|
||||||
throw new Error(Zotero.Sync.Storage.defaultError);
|
Zotero.debug(e.xmlhttp.getAllResponseHeaders());
|
||||||
|
throw new Error(Zotero.Sync.Storage.defaultError);
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
var version = req.getResponseHeader('Last-Modified-Version');
|
var version = req.getResponseHeader('Last-Modified-Version');
|
||||||
|
|
|
@ -209,6 +209,11 @@ Zotero.Sync.Runner_Module = function (options = {}) {
|
||||||
setStatus: this.setSyncStatus.bind(this),
|
setStatus: this.setSyncStatus.bind(this),
|
||||||
stopOnError,
|
stopOnError,
|
||||||
onError: function (e) {
|
onError: function (e) {
|
||||||
|
// Ignore cancelled requests
|
||||||
|
if (e instanceof Zotero.HTTP.CancelledException) {
|
||||||
|
Zotero.debug("Request was cancelled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (options.onError) {
|
if (options.onError) {
|
||||||
options.onError(e);
|
options.onError(e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue