Catch environment errors when reading 3MF archive metadata

The file could get deleted in the meanwhile.

Fixes Sentry issue CURA-1CK.
This commit is contained in:
Ghostkeeper 2020-11-04 14:25:39 +01:00
parent 9ffc6bc705
commit b740fda491
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -805,6 +805,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
except zipfile.BadZipFile:
Logger.logException("w", "Unable to retrieve metadata from {fname}: 3MF archive is corrupt.".format(fname = file_name))
return result
except EnvironmentError as e:
Logger.logException("w", "Unable to retrieve metadata from {fname}: File is inaccessible. Error: {err}".format(fname = file_name, err = str(e)))
return result
metadata_files = [name for name in archive.namelist() if name.endswith("plugin_metadata.json")]