mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Catch environment errors removing temporary package files
Could be removed or not having access rights. Fixes Sentry issue CURA-1K6.
This commit is contained in:
parent
1b8463ba30
commit
a9c8c63442
1 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,6 @@
|
|||
# Copyright (c) 2021 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import os
|
||||
from typing import List, Dict, Any, cast
|
||||
|
||||
|
@ -96,7 +99,10 @@ class SyncOrchestrator(Extension):
|
|||
else:
|
||||
self._cloud_api.unsubscribe(item["package_id"])
|
||||
# delete temp file
|
||||
try:
|
||||
os.remove(item["package_path"])
|
||||
except EnvironmentError as e: # File was already removed, no access rights, etc.
|
||||
Logger.error("Can't delete temporary package file: {err}".format(err = str(e)))
|
||||
|
||||
if has_changes:
|
||||
self._restart_presenter.present()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue