mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-23 06:09:38 +08:00
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.
This commit is contained in:
parent
6e2738a254
commit
1ce8ef3293
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user