Merge pull request #4800 from heewa/abort-save-when-unable-to-finish

App: Abort save when unable to finish
This commit is contained in:
Yorik van Havre
2021-09-20 10:47:57 +02:00
committed by GitHub

View File

@@ -2401,8 +2401,8 @@ private:
Base::FileInfo tmp(sourcename);
if (tmp.renameFile(targetname.c_str()) == false) {
Base::Console().Warning("Cannot rename file from '%s' to '%s'\n",
sourcename.c_str(), targetname.c_str());
throw Base::FileException(
"Cannot rename tmp save file to project file", targetname);
}
}
void applyTimeStamp(const std::string& sourcename, const std::string& targetname) {
@@ -2534,9 +2534,8 @@ private:
Base::FileInfo tmp(sourcename);
if (tmp.renameFile(targetname.c_str()) == false) {
Base::Console().Error("Save interrupted: Cannot rename file from '%s' to '%s'\n",
sourcename.c_str(), targetname.c_str());
//throw Base::FileException("Save interrupted: Cannot rename temporary file to project file", tmp);
throw Base::FileException(
"Save interrupted: Cannot rename temporary file to project file", tmp);
}
if (numberOfFiles <= 0) {