Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2020-11-18 03:57:49 +0300
committerGhostkeeper <rubend@tutanota.com>2020-11-18 03:57:49 +0300
commiteeecd545dbde7df5d6ac58a245dd91897560457d (patch)
tree88b6806e090e42903d6b0a5cb93ecf9aca372ca3 /plugins/3MFReader
parent1cd575702993dd08a9b4239ec37e89ad9ac1b2b4 (diff)
Catch errors for corrupted zip files when reading project files
Fixes Sentry issue CURA-1DG.
Diffstat (limited to 'plugins/3MFReader')
-rwxr-xr-xplugins/3MFReader/ThreeMFWorkspaceReader.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py
index 8db043f6a6..1c0088dd98 100755
--- a/plugins/3MFReader/ThreeMFWorkspaceReader.py
+++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py
@@ -636,6 +636,13 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
message.show()
self.setWorkspaceName("")
return [], {}
+ except zipfile.BadZipFile as e:
+ message = Message(i18n_catalog.i18nc("@info:error Don't translate the XML tags <filename> or <message>!",
+ "Project file <filename>{0}</filename> is corrupt: <message>{1}</message>.", file_name, str(e)),
+ title = i18n_catalog.i18nc("@info:title", "Can't Open Project File"))
+ message.show()
+ self.setWorkspaceName("")
+ return [], {}
cura_file_names = [name for name in archive.namelist() if name.startswith("Cura/")]