mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 11:47:50 -06:00
Don't crash if a material fails to be written in the zip
This fixes Sentry issue CURA-2WS.
This commit is contained in:
parent
1305abac6f
commit
fe640d42cf
1 changed files with 4 additions and 1 deletions
|
@ -296,4 +296,7 @@ class MaterialManagementModel(QObject):
|
|||
material = registry.findContainers(id = metadata["id"])[0]
|
||||
suffix = registry.getMimeTypeForContainer(type(material)).preferredSuffix
|
||||
filename = metadata["id"] + "." + suffix
|
||||
archive.writestr(filename, material.serialize())
|
||||
try:
|
||||
archive.writestr(filename, material.serialize())
|
||||
except OSError as e:
|
||||
Logger.log("e", f"An error has occurred while writing the material \'{metadata['id']}\' in the file \'{filename}\': {e}.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue