mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Catch OSError when actually writing the UFP stream
This includes getting an error message when we don't have write access any more or when the file was deleted or connection lost while we were writing to it. Fixes Sentry issue CURA-GX.
This commit is contained in:
parent
54b6c2a54e
commit
1047cdd76c
1 changed files with 8 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
#Copyright (c) 2019 Ultimaker B.V.
|
||||
#Copyright (c) 2020 Ultimaker B.V.
|
||||
#Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from typing import cast
|
||||
|
@ -131,5 +131,11 @@ class UFPWriter(MeshWriter):
|
|||
|
||||
added_materials.append(material_file_name)
|
||||
|
||||
archive.close()
|
||||
try:
|
||||
archive.close()
|
||||
except OSError as e:
|
||||
error_msg = catalog.i18nc("@info:error", "Can't write to UFP file:") + " " + str(e)
|
||||
self.setInformation(error_msg)
|
||||
Logger.error(error_msg)
|
||||
return False
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue