mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Catch errors for corrupted zip files when reading project files
Fixes Sentry issue CURA-1DG.
This commit is contained in:
parent
1cd5757029
commit
eeecd545db
1 changed files with 7 additions and 0 deletions
|
@ -636,6 +636,13 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
message.show()
|
message.show()
|
||||||
self.setWorkspaceName("")
|
self.setWorkspaceName("")
|
||||||
return [], {}
|
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/")]
|
cura_file_names = [name for name in archive.namelist() if name.startswith("Cura/")]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue