commit 764b8d3618c2d293d1be79af652b796754d2b6ae
parent 6064a230cdb37891abba395a7810267eab604d4c
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 24 Dec 2009 23:20:14 +0000
More helpful error for moveTo() error with orphaned files during upgrade
Diffstat:
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js
@@ -1969,7 +1969,18 @@ Zotero.Schema = new function(){
target.remove(false);
}
}
- orphan.file.moveTo(orphaned, newName);
+ try {
+ orphan.file.moveTo(orphaned, newName);
+ }
+ catch (e) {
+ if (e.name == 'NS_ERROR_FILE_ACCESS_DENIED') {
+ throw ("Zotero cannot move orphaned file '" + orphan.file.path + "'");
+ }
+ else {
+ Components.utils.reportError("Error moving orphaned file '" + orphan.file.leafName + "'");
+ throw (e);
+ }
+ }
movedFiles37[orphan.id] = orphan.file;
}
}
@@ -2256,7 +2267,18 @@ Zotero.Schema = new function(){
target.remove(false);
}
}
- orphan.file.moveTo(orphaned, newName);
+ try {
+ orphan.file.moveTo(orphaned, newName);
+ }
+ catch (e) {
+ if (e.name == 'NS_ERROR_FILE_ACCESS_DENIED') {
+ throw ("Zotero cannot move orphaned file '" + orphan.file.path + "'");
+ }
+ else {
+ Components.utils.reportError("Error moving orphaned file '" + orphan.file.leafName + "'");
+ throw (e);
+ }
+ }
movedFiles46[orphan.id] = orphan.file;
}
}