Don't crash Cura when material file is wrongly formatted

That was the whole point of this change. Instead degrade gracefully. It won't load the material file but give an error message saying that the material is corrupt. Then it won't be able to load the stack as well because the material doesn't exist, and give an error about the stack as well.

Contributes to issue CURA-5045.
This commit is contained in:
Ghostkeeper 2018-04-12 16:56:05 +02:00
parent e96c50a582
commit 1769a69792
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -698,7 +698,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
except ContainerFormatError:
Logger.logException("e", "Failed to deserialize material file %s in project file %s",
material_container_file, file_name)
raise
continue
if need_new_name:
new_name = ContainerRegistry.getInstance().uniqueName(material_container.getName())
material_container.setName(new_name)