commit 43ff47be5b355f60bfcb600e3fd7578f599ac62f
parent 5a8d669eccd83b3f68f421e3031c3f38238e88f7
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 13 Feb 2012 20:09:10 -0500
Ignore errors from individual files when rebuilding index
Diffstat:
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js
@@ -502,7 +502,7 @@ Zotero.Fulltext = new function(){
}
- function indexItems(items, complete) {
+ function indexItems(items, complete, ignoreErrors) {
if (items.constructor.name != 'Array') {
items = [items];
}
@@ -522,7 +522,19 @@ Zotero.Fulltext = new function(){
continue;
}
- this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete);
+ if (ignoreErrors) {
+ try {
+ this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete);
+ }
+ catch (e) {
+ Zotero.debug(e, 1);
+ Components.utils.reportError("Error indexing " + file.path);
+ Components.utils.reportError(e);
+ }
+ }
+ else {
+ this.indexFile(file, i.attachmentMIMEType, i.attachmentCharset, i.id, !complete);
+ }
}
Zotero.DB.commitTransaction();
@@ -902,7 +914,7 @@ Zotero.Fulltext = new function(){
if (items) {
Zotero.DB.query("DELETE FROM fulltextItemWords WHERE itemID IN (" + sql + ")");
Zotero.DB.query("DELETE FROM fulltextItems WHERE itemID IN (" + sql + ")");
- this.indexItems(items);
+ this.indexItems(items, false, true);
}
Zotero.DB.commitTransaction();
}