View Single Post
Old 09-03-2024, 05:31 PM   #30
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,937
Karma: 6361444
Join Date: Nov 2009
Device: many
Either way you end up in the LoadFile() routine in MainWindow.cpp and the exception (a runtime exception) is caught here:

Code:
  } catch (const std::runtime_error &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
       QApplication::restoreOverrideCursor();
       Utility::DisplayStdErrorDialog(err);
   }

    // If we got to here some sort of error occurred while loading the file
    // and potentially has left the GUI in a nasty state (like on initial startup)
    // Fallback to displaying a new book instead so GUI integrity is maintained.
    CreateNewBook();
    return false;
}

And a new empty epub is created as a result in an attempt to keep going.

So for some reason, this code is not happening when launching sigil by double-clicking on a epub on Windows?
KevinH is online now   Reply With Quote