Handle IO error on document save (#961)
* Add try/except to document replace call * Try the os.replace command 5 times * Just use else condition on for loop instead * Make the exceptions explicitly OSError * Revert the os.replace loop, as this is not the issue
This commit is contained in:
committed by
GitHub
parent
8b603d15a5
commit
ec07cebb51
@@ -715,7 +715,7 @@ class NWProject():
|
||||
if os.path.isfile(saveFile):
|
||||
os.replace(saveFile, backFile)
|
||||
os.replace(tempFile, saveFile)
|
||||
except Exception as exc:
|
||||
except OSError as exc:
|
||||
self.theParent.makeAlert(self.tr(
|
||||
"Failed to save project."
|
||||
), nwAlert.ERROR, exception=exc)
|
||||
|
||||
Reference in New Issue
Block a user