From 5a686c5460e9fbb32af5014d0dbf1169ea301ec2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 17 Mar 2017 12:40:02 +0200 Subject: Catch and dump unhandled exceptions in async task functions The problem with relying on noexcept for this is that there is no stack. --- build2/test/rule.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'build2/test/rule.cxx') diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index 5cec8912..0e1aff66 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -397,6 +397,12 @@ namespace build2 { r = scope_state::failed; } + catch (const std::exception& e) + { + *diag_stream << "unhandled exception: " << e; + assert (false); + abort (); + } return r; } -- cgit