From c7960fbd891039709d18a7e2005588e8654d3f19 Mon Sep 17 00:00:00 2001 From: gm Date: Thu, 2 Jun 2016 00:52:32 +1200 Subject: [PATCH] Catch and display exception messages a Microsofts C runtime on Windows doesn't show them otherwise. --- test/tz_test/validate.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/tz_test/validate.cpp b/test/tz_test/validate.cpp index adf5cb6..5a7ee08 100644 --- a/test/tz_test/validate.cpp +++ b/test/tz_test/validate.cpp @@ -83,8 +83,8 @@ test_info(const date::time_zone* zone, const date::sys_info& info) } } -int -main() +void +tzmain() { using namespace date; using namespace std::chrono; @@ -142,4 +142,19 @@ main() } std::cout << '\n'; } -} \ No newline at end of file +} + +int +main() +{ + try + { + tzmain(); + } + catch(const std::exception& ex) + { + std::cout << "An exception occured: " << ex.what() << std::endl; + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +}