diff --git a/chrome/content/zotero/xpcom/file.js b/chrome/content/zotero/xpcom/file.js index d39176129d..b9e20f0df2 100644 --- a/chrome/content/zotero/xpcom/file.js +++ b/chrome/content/zotero/xpcom/file.js @@ -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'); diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 169d32c0dc..7eabafada6 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -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 =