More helpful error for moveTo() error with orphaned files during upgrade

This commit is contained in:
Dan Stillman 2009-12-24 23:20:14 +00:00
parent 6064a230cd
commit 764b8d3618

View file

@ -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;
}
}