Wrap FS::write in try catch
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
d38e7fa142
commit
d2f0d1d8d5
@ -173,7 +173,11 @@ void InstanceCopyTask::copyFinished()
|
|||||||
allowed_symlinks_file
|
allowed_symlinks_file
|
||||||
.filePath()); // we dont want to modify the original. also make sure the resulting file is not itself a link.
|
.filePath()); // we dont want to modify the original. also make sure the resulting file is not itself a link.
|
||||||
|
|
||||||
|
try {
|
||||||
FS::write(allowed_symlinks_file.filePath(), allowed_symlinks);
|
FS::write(allowed_symlinks_file.filePath(), allowed_symlinks);
|
||||||
|
} catch (const FS::FileSystemException& e) {
|
||||||
|
qCritical() << "Failed to write symlink :" << e.cause();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emitSucceeded();
|
emitSucceeded();
|
||||||
|
@ -164,7 +164,12 @@ void ExportToModListDialog::done(int result)
|
|||||||
|
|
||||||
if (output.isEmpty())
|
if (output.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
try {
|
||||||
FS::write(output, ui->finalText->toPlainText().toUtf8());
|
FS::write(output, ui->finalText->toPlainText().toUtf8());
|
||||||
|
} catch (const FS::FileSystemException& e) {
|
||||||
|
qCritical() << "Failed to save mod list file :" << e.cause();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QDialog::done(result);
|
QDialog::done(result);
|
||||||
|
Loading…
Reference in New Issue
Block a user