From 1afa693fd84d34357476a89816236f673441151e Mon Sep 17 00:00:00 2001 From: chn Date: Sun, 5 May 2024 10:14:24 +0800 Subject: [PATCH] use boost to catch all exceptions --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3738353..61f0d29 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,7 @@ # include # include # include +# include int main(int argc, const char** argv) { @@ -123,7 +124,6 @@ int main(int argc, const char** argv) } else { std::cerr << "Unknown command.\n"; return 1; } } - catch (const std::exception& e) { std::cerr << fmt::format("Exception: {}\n", e.what()); return 1; } - catch (...) { std::cerr << "Unknown exception.\n"; return 1; } + catch (...) { std::cerr << boost::current_exception_diagnostic_information() << std::endl; return 1; } return 0; }