From eeaf8d90d9d2105be1b4137ae6a609adde58d291 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Fri, 3 May 2024 10:36:02 +0200 Subject: [PATCH] PICARD-2885: Fix file permission and not found error icons not being shown Majority of file errors happen inside mutagen and are wrapped into a MutagenError. This hid the handling of the specific error conditions for permission and file not found errors. --- picard/file.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/picard/file.py b/picard/file.py index 9d17bc002..4278e5d03 100644 --- a/picard/file.py +++ b/picard/file.py @@ -211,13 +211,13 @@ class File(QtCore.QObject, Item): def _set_error(self, error): self.state = File.ERROR - if any_exception_isinstance(error, MutagenError): - self.error_type = FileErrorType.PARSER - self.error_append(_("The file failed to parse, either the file is damaged or has an unsupported file format.")) - elif any_exception_isinstance(error, FileNotFoundError): + if any_exception_isinstance(error, FileNotFoundError): self.error_type = FileErrorType.NOTFOUND elif any_exception_isinstance(error, PermissionError): self.error_type = FileErrorType.NOACCESS + elif any_exception_isinstance(error, MutagenError): + self.error_type = FileErrorType.PARSER + self.error_append(_("The file failed to parse, either the file is damaged or has an unsupported file format.")) else: self.error_type = FileErrorType.UNKNOWN self.error_append(str(error))