Merge pull request #16606 from Ultimaker/CURA-10180-warning_out_of_space

Fixed possibly wrong error message
This commit is contained in:
Saumya Jain 2023-09-01 17:39:10 +02:00 committed by GitHub
commit 6e781f4583
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -40,7 +40,9 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
# Indicate that the 3mf mesh writer should not close the archive just yet (we still need to add stuff to it). # Indicate that the 3mf mesh writer should not close the archive just yet (we still need to add stuff to it).
mesh_writer.setStoreArchive(True) mesh_writer.setStoreArchive(True)
mesh_writer.write(stream, nodes, mode) if not mesh_writer.write(stream, nodes, mode):
self.setInformation(mesh_writer.getInformation())
return False
archive = mesh_writer.getArchive() archive = mesh_writer.getArchive()
if archive is None: # This happens if there was no mesh data to write. if archive is None: # This happens if there was no mesh data to write.
@ -98,7 +100,7 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
Logger.error("No permission to write workspace to this stream.") Logger.error("No permission to write workspace to this stream.")
return False return False
except EnvironmentError as e: except EnvironmentError as e:
self.setInformation(catalog.i18nc("@error:zip", "The operating system does not allow saving a project file to this location or with this file name.")) self.setInformation(catalog.i18nc("@error:zip", str(e)))
Logger.error("EnvironmentError when writing workspace to this stream: {err}".format(err = str(e))) Logger.error("EnvironmentError when writing workspace to this stream: {err}".format(err = str(e)))
return False return False
mesh_writer.setStoreArchive(False) mesh_writer.setStoreArchive(False)

View File

@ -237,9 +237,9 @@ class ThreeMFWriter(MeshWriter):
archive.writestr(model_file, scene_string) archive.writestr(model_file, scene_string)
archive.writestr(content_types_file, b'<?xml version="1.0" encoding="UTF-8"?> \n' + ET.tostring(content_types)) archive.writestr(content_types_file, b'<?xml version="1.0" encoding="UTF-8"?> \n' + ET.tostring(content_types))
archive.writestr(relations_file, b'<?xml version="1.0" encoding="UTF-8"?> \n' + ET.tostring(relations_element)) archive.writestr(relations_file, b'<?xml version="1.0" encoding="UTF-8"?> \n' + ET.tostring(relations_element))
except Exception as e: except Exception as error:
Logger.logException("e", "Error writing zip file") Logger.logException("e", "Error writing zip file")
self.setInformation(catalog.i18nc("@error:zip", "Error writing 3mf file.")) self.setInformation(str(error))
return False return False
finally: finally:
if not self._store_archive: if not self._store_archive: