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?