Make attachment post-process failures non-fatal
This is generally just detecting the character set and/or indexing, so it's not the end of the world if it fails.
This commit is contained in:
parent
2a7f31813e
commit
2d6332212c
1 changed files with 23 additions and 8 deletions
|
@ -117,7 +117,12 @@ Zotero.Attachments = new function(){
|
|||
attachmentItem.attachmentPath = newFile.path;
|
||||
yield attachmentItem.save(saveOptions);
|
||||
}.bind(this));
|
||||
yield _postProcessFile(attachmentItem, newFile, contentType);
|
||||
try {
|
||||
yield _postProcessFile(attachmentItem, newFile, contentType);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
|
@ -170,7 +175,12 @@ Zotero.Attachments = new function(){
|
|||
collections,
|
||||
saveOptions
|
||||
});
|
||||
yield _postProcessFile(item, file, contentType);
|
||||
try {
|
||||
yield _postProcessFile(item, file, contentType);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
return item;
|
||||
});
|
||||
|
||||
|
@ -232,12 +242,17 @@ Zotero.Attachments = new function(){
|
|||
file.parent.copyTo(storageDir, destDir.leafName);
|
||||
}
|
||||
}.bind(this));
|
||||
yield _postProcessFile(
|
||||
attachmentItem,
|
||||
Zotero.File.pathToFile(newPath),
|
||||
contentType,
|
||||
charset
|
||||
);
|
||||
try {
|
||||
yield _postProcessFile(
|
||||
attachmentItem,
|
||||
Zotero.File.pathToFile(newPath),
|
||||
contentType,
|
||||
charset
|
||||
);
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue