From 8295ee7ed24c82eceff15eddc57caa9ab5eda969 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sun, 5 Jan 2025 14:09:38 +0100 Subject: Catch errors in ctors --- main.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 548b8c5..d22442a 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,13 @@ #include "MainLoop.h" int main() { - MainLoop main_loop; - return main_loop.run(); + + try { + MainLoop main_loop; + return main_loop.run(); + } catch (const std::exception& ex) { + std::cerr << "Error: " << ex.what() << std::endl; + } + + return 1; } -- cgit v1.2.3