Skip to content

Commit

Permalink
try catch for advanced observing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias-Schartner committed Apr 12, 2021
1 parent d893ea7 commit 40977d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Models/model_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ QVariant Model_Mode::data(const QModelIndex &index, int role) const
return "Standard";
case 6:
if(data_->getTrackFrameFormat(row).is_initialized()){
return QString::fromStdString(*data_->getTrackFrameFormat(row).get());
try {
return QString::fromStdString(*data_->getTrackFrameFormat(row).get());
} catch (...) {
return "undefined";
}
}else{
return "undefined";
}
Expand Down
10 changes: 6 additions & 4 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2223,11 +2223,13 @@ void MainWindow::on_pushButton_startAdvancedMode_clicked()
ObsModeDialog *obsModeDial = new ObsModeDialog(obsModeStart, this);
int result = obsModeDial->exec();
if(result == QDialog::Accepted){
advancedObservingMode_ = obsModeDial->getObservingMode();
updateAdvancedObservingMode();

try{
advancedObservingMode_ = obsModeDial->getObservingMode();
updateAdvancedObservingMode();
}catch(...){
QMessageBox::critical(this, "error using advanced observing mode", "error using advanced observing mode - please check catalogs and entries.");
}
}

delete(obsModeDial);
}

Expand Down

0 comments on commit 40977d5

Please sign in to comment.