From 208313dba1687489962b159f31c25ea79322dd8d Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 2 Jan 2020 15:05:04 +0100 Subject: main: Terminate if an exception is thrown. --- src/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d75d7dc9a..4ff13c157 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -235,16 +235,19 @@ static void UniversalMain(std::unique_ptr 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!"); } -- cgit v1.2.3