Implement exception message box popups (#1104)
This commit is contained in:
parent
7d0f7f9dba
commit
ce8f6bca9f
|
@ -1,6 +1,7 @@
|
|||
21.08+ (???)
|
||||
------------------------------------------------------------------------
|
||||
- Fix: [#1108] Road selection not being remembered.
|
||||
- Change: [#1104] Exceptions now trigger a message box popup, instead of only being written to the console.
|
||||
|
||||
21.08 (2021-08-12)
|
||||
------------------------------------------------------------------------
|
||||
|
|
|
@ -202,6 +202,7 @@ namespace OpenLoco::Environment
|
|||
catch (const std::exception& e)
|
||||
{
|
||||
std::fprintf(stderr, "Unable to create directory: %s\n", e.what());
|
||||
Ui::showMessageBox("Unable to create directory", e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "../Environment.h"
|
||||
#include "../Interop/Interop.hpp"
|
||||
#include "../Platform/Platform.h"
|
||||
#include "../Ui.h"
|
||||
#include "../Utility/Yaml.hpp"
|
||||
#include "Conversion.h"
|
||||
#include "StringIds.h"
|
||||
|
@ -258,6 +259,7 @@ namespace OpenLoco::Localisation
|
|||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << e.what() << "\n";
|
||||
Ui::showMessageBox("Exception", e.what());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -330,6 +330,7 @@ namespace OpenLoco::Map::TileManager
|
|||
}
|
||||
catch (const std::bad_alloc&)
|
||||
{
|
||||
Ui::showMessageBox("Bad Alloc", "Bad memory allocation, exiting");
|
||||
exitWithError(4370, StringIds::null);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1189,9 +1189,10 @@ namespace OpenLoco
|
|||
// TODO extra clean up code
|
||||
}
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << ex.what() << std::endl;
|
||||
std::cerr << e.what() << std::endl;
|
||||
Ui::showMessageBox("Exception", e.what());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue