Let the FileNotFound error be handled later in the read file process

An error will pop up by the ReadFileJob if the file cannot be found. If we also handle the File
NotFound error in the checkIsValidProjectFile, then two error message will pop up in the user's
screen, which is not desired. So, let only the ReadFileJob show it's error instead.

CURA-7996
This commit is contained in:
Kostas Karmas 2021-02-08 11:59:32 +01:00
parent 56b3cc5fe5
commit 7be67f43f8

View file

@ -1941,14 +1941,7 @@ class CuraApplication(QtApplication):
try:
result = workspace_reader.preRead(file_path, show_dialog=False)
return result == WorkspaceReader.PreReadResult.accepted
except FileNotFoundError:
result_message = Message(text = self._i18n_catalog.i18nc("@info:status Don't translate the XML tag <filename>!",
"Failed to load <filename>{0}</filename>. File is moved or deleted.",
file_path), lifetime = 0,
title = self._i18n_catalog.i18nc("@info:title", "Unable to Open File"))
result_message.show()
return False
except Exception:
except:
Logger.logException("e", "Could not check file %s", file_url)
return False