diff options
author | Konstantinos Karmas <konskarm@gmail.com> | 2021-09-21 10:33:30 +0300 |
---|---|---|
committer | Konstantinos Karmas <konskarm@gmail.com> | 2021-09-21 10:33:30 +0300 |
commit | fe640d42cfc87fea996fd0c147221022cc2280cd (patch) | |
tree | fa82279f79696cffa2d2d7abb2cb761bfe1c8ca1 /cura/Machines | |
parent | 1305abac6f2127e8bbeb9751ad7880b3cd5746f6 (diff) |
Don't crash if a material fails to be written in the zip
This fixes Sentry issue CURA-2WS.
Diffstat (limited to 'cura/Machines')
-rw-r--r-- | cura/Machines/Models/MaterialManagementModel.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py index 6663dbdae1..40d81004fe 100644 --- a/cura/Machines/Models/MaterialManagementModel.py +++ b/cura/Machines/Models/MaterialManagementModel.py @@ -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}.") |