1
0

main: Terminate if an exception is thrown.

This commit is contained in:
Mattes D 2020-01-02 15:05:04 +01:00
parent 3c5278d3c2
commit 208313dba1

View File

@ -235,16 +235,19 @@ static void UniversalMain(std::unique_ptr<cSettingsRepositoryInterface> a_Overri
cRoot Root; cRoot Root;
Root.Start(std::move(a_OverridesRepo)); Root.Start(std::move(a_OverridesRepo));
} }
catch (fmt::FormatError & f) catch (const fmt::FormatError & exc)
{ {
FLOGERROR("Formatting exception: {0}", f.what()); cRoot::m_TerminateEventRaised = true;
FLOGERROR("Formatting exception: {0}", exc.what());
} }
catch (std::exception & e) catch (const std::exception & exc)
{ {
LOGERROR("Standard exception: %s", e.what()); cRoot::m_TerminateEventRaised = true;
LOGERROR("Standard exception: %s", exc.what());
} }
catch (...) catch (...)
{ {
cRoot::m_TerminateEventRaised = true;
LOGERROR("Unknown exception!"); LOGERROR("Unknown exception!");
} }