aboutsummaryrefslogtreecommitdiff
path: root/build2/test/rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-17 12:40:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-17 12:40:02 +0200
commit5a686c5460e9fbb32af5014d0dbf1169ea301ec2 (patch)
treeaa219f442926ef4879acb2c14f7eead47f9f3d33 /build2/test/rule.cxx
parentde09beabe1448e9c6b401ec9acdd69ee5bf0f0e2 (diff)
Catch and dump unhandled exceptions in async task functions
The problem with relying on noexcept for this is that there is no stack.
Diffstat (limited to 'build2/test/rule.cxx')
-rw-r--r--build2/test/rule.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx
index 5cec891..0e1aff6 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;
}