Skip to content

Commit

Permalink
main: Terminate if an exception is thrown.
Browse files Browse the repository at this point in the history
  • Loading branch information
madmaxoft committed Jan 7, 2020
1 parent 3c5278d commit 208313d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,16 +235,19 @@ static void UniversalMain(std::unique_ptr<cSettingsRepositoryInterface> a_Overri
cRoot Root;
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 (...)
{
cRoot::m_TerminateEventRaised = true;
LOGERROR("Unknown exception!");
}

Expand Down

0 comments on commit 208313d

Please sign in to comment.