mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-05 14:35:23 +00:00
Improved error handling when opening files
This commit is contained in:
parent
63cb5e4f67
commit
e4106fe3a2
3 changed files with 18 additions and 3 deletions
|
|
@ -178,7 +178,12 @@ AppWindow::AppWindow(QWidget *parent)
|
|||
return;
|
||||
}
|
||||
nlohmann::json j;
|
||||
file >> j;
|
||||
try {
|
||||
file >> j;
|
||||
} catch (exception &e) {
|
||||
QMessageBox::warning(nullptr, "Error", "Failed to parse the setup file (" + QString(e.what()) + ")");
|
||||
qWarning() << "Parsing of setup file failed: " << e.what();
|
||||
}
|
||||
file.close();
|
||||
LoadSetup(j);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue