Add a top-level catch-handler for std::string

This commit is contained in:
tomcw 2021-12-11 20:27:39 +00:00
parent 408f5fe42f
commit 19aadbfb8d
2 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,7 @@ LanguageCardUnit::LanguageCardUnit(SS_CARDTYPE type, UINT slot) :
m_uLastRamWrite(0)
{
if (m_slot != LanguageCardUnit::kSlot0)
throw std::string("Card: wrong slot");
throw std::string("Language Card: wrong slot"); // throws to the top-level catch-handler, and shuts down
SetMemMainLanguageCard(NULL, true);
}

View File

@ -577,6 +577,10 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int)
{
ExceptionHandler(exception.what());
}
catch(std::string error)
{
ExceptionHandler(error.c_str());
}
Shutdown();
return 0;