mirror of
https://github.com/zotero/zotero.git
synced 2026-10-05 02:43:38 +00:00
Show file access error for NS_ERROR_FILE_FS_CORRUPTED
Windows returns this for ERROR_FILE_CORRUPT/ERROR_DISK_CORRUPT. It's not in xpc.msg, so the exception has an empty name and isn't in Components.results, and it was falling through to the generic file sync error instead of the file access error with the path. Show a message about the reported corruption in place of the usual permissions advice. https://forums.zotero.org/discussion/133592/
This commit is contained in:
parent
e3da52bebc
commit
f3810befde
2 changed files with 16 additions and 3 deletions
|
|
@ -1727,16 +1727,27 @@ Zotero.File = new function () {
|
|||
if (e.name == 'NS_ERROR_FILE_ACCESS_DENIED' || e.name == 'NS_ERROR_FILE_IS_LOCKED'
|
||||
// These show up on some Windows systems
|
||||
|| e.name == 'NS_ERROR_FAILURE' || e.name == 'NS_ERROR_FILE_NOT_FOUND'
|
||||
// NS_ERROR_FILE_FS_CORRUPTED (Windows ERROR_FILE_CORRUPT/ERROR_DISK_CORRUPT), which
|
||||
// isn't in Components.results or exposed as an exception name
|
||||
|| e.result == 0x80520016
|
||||
// OS.File.Error
|
||||
|| e.becauseAccessDenied || e.becauseNoSuchFile
|
||||
// IOUtils
|
||||
|| e.name == 'NotAllowedError'
|
||||
|| e.name == 'ReadOnlyError'
|
||||
|| e.name == 'NotFoundError') {
|
||||
let checkFileWindows = Zotero.getString('file.accessError.message.windows');
|
||||
let checkFileOther = Zotero.getString('file.accessError.message.other');
|
||||
let checkFile;
|
||||
if (e.result == 0x80520016) {
|
||||
checkFile = Zotero.ftl.formatValueSync('file-access-error-fs-corrupted');
|
||||
}
|
||||
else if (Zotero.isWin) {
|
||||
checkFile = Zotero.getString('file.accessError.message.windows');
|
||||
}
|
||||
else {
|
||||
checkFile = Zotero.getString('file.accessError.message.other');
|
||||
}
|
||||
let msg = str + "\n\n"
|
||||
+ (Zotero.isWin ? checkFileWindows : checkFileOther)
|
||||
+ checkFile
|
||||
+ "\n\n"
|
||||
+ Zotero.getString('file.accessError.restart');
|
||||
|
||||
|
|
|
|||
|
|
@ -362,6 +362,8 @@ item-button-view-online =
|
|||
|
||||
file-renaming-file-renamed-to = File renamed to { $filename }
|
||||
|
||||
file-access-error-fs-corrupted = { -os-name } reported that the file or disk is corrupted. Run a disk check on the drive containing the file.
|
||||
|
||||
itembox-button-options =
|
||||
.tooltiptext = Open context menu
|
||||
itembox-button-merge =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue