Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2020-09-08 14:01:10 +0300
committerGhostkeeper <rubend@tutanota.com>2020-09-08 14:01:10 +0300
commit1ce8ef3293d0f5409e01f7bc5f2bd3d89cf7b5d5 (patch)
tree1654dc1531b541d9584f1859b990700f8cf0a3ce /plugins/3MFWriter
parent6e2738a25489f5c38d1177915c1f9d51545c4ac3 (diff)
Catch OSError and related errors when saving workspaces
This should prevent a crash when saving to a path that the file system doesn't support (because of e.g. disallowed symbols in the file name). Instead it will now show an error message to the user. Fixes Sentry issue CURA-157.
Diffstat (limited to 'plugins/3MFWriter')
-rw-r--r--plugins/3MFWriter/ThreeMFWorkspaceWriter.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
index 69b1e51247..9f4ab8e5fa 100644
--- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
+++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py
@@ -92,6 +92,10 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter):
self.setInformation(catalog.i18nc("@error:zip", "No permission to write the workspace here."))
Logger.error("No permission to write workspace to this stream.")
return False
+ 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."))
+ Logger.error("EnvironmentError when writing workspace to this stream: {err}".format(err = str(e)))
+ return False
mesh_writer.setStoreArchive(False)
return True