More helpful error for moveTo() error with orphaned files during upgrade
This commit is contained in:
parent
6064a230cd
commit
764b8d3618
1 changed files with 24 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue