Skip to content

Commit

Permalink
also handle std::exceptions during LoadFile
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhendricks committed Sep 3, 2024
1 parent e08c313 commit 4d0741a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MainUI/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5317,6 +5317,13 @@ bool MainWindow::LoadFile(const QString &fullfilepath, bool is_internal)
Utility::DisplayExceptionErrorDialog(tr("Cannot load file %1: %2")
.arg(QDir::toNativeSeparators(fullfilepath))
.arg(e.what()));
} catch (const std::exception &e) {
ShowMessageOnStatusBar();
// ImportHTML/ImportEPUB use wait cursor and can throw exceptions caught here
QApplication::restoreOverrideCursor();
Utility::DisplayExceptionErrorDialog(tr("Cannot load file %1: %2")
.arg(QDir::toNativeSeparators(fullfilepath))
.arg(e.what()));
} catch (QString& err) {
ShowMessageOnStatusBar();
// ImportHTML/ImportEPUB use wait cursor and can throw exceptions caught here
Expand Down

0 comments on commit 4d0741a

Please sign in to comment.