Skip to content

Commit

Permalink
Add a top-level catch-handler for std::string
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcw committed Dec 11, 2021
1 parent 408f5fe commit 19aadbf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/LanguageCard.cpp
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions source/Windows/AppleWin.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 19aadbf

Please sign in to comment.