aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/function.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-11-05 07:57:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-11-05 07:57:50 +0200
commitee9783367a1e933b9af49a89a4fb8e0a027bcf5d (patch)
tree95874bde346619ca6e916a7593be64dbd0f6b932 /libbuild2/function.cxx
parent56b860217eb00827ba15fc975f71008080af9b65 (diff)
Fix function call diagnostics to use diag_frame
Diffstat (limited to 'libbuild2/function.cxx')
-rw-r--r--libbuild2/function.cxx17
1 files changed, 8 insertions, 9 deletions
diff --git a/libbuild2/function.cxx b/libbuild2/function.cxx
index f790809..6fa9709 100644
--- a/libbuild2/function.cxx
+++ b/libbuild2/function.cxx
@@ -207,16 +207,15 @@ namespace build2
{
// Print the call location in case the function fails.
//
- auto g (
- make_exception_guard (
- [fa, &loc, &print_call] ()
+ auto df = make_diag_frame (
+ [fa, &loc, &print_call] (const diag_record& dr)
+ {
+ if (fa)
{
- if (fa && verb != 0)
- {
- diag_record dr (info (loc));
- dr << "while calling "; print_call (dr.os);
- }
- }));
+ dr << info (loc) << "while calling ";
+ print_call (dr.os);
+ }
+ });
auto f (ovls.back ());