diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-05-12 16:11:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-05-12 16:11:48 +0200 |
commit | 73546642ff887b0a887d00ac43395afde99577b3 (patch) | |
tree | ce090031b6b1b19185f4dbed897e513adc6b0c9d /bbot/diagnostics.hxx | |
parent | ea9063805ce849d2ef81396e53aa1437a520fe5e (diff) |
Do soft/hard fail properly
Diffstat (limited to 'bbot/diagnostics.hxx')
-rw-r--r-- | bbot/diagnostics.hxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bbot/diagnostics.hxx b/bbot/diagnostics.hxx index bfeeb2a..36a3cf2 100644 --- a/bbot/diagnostics.hxx +++ b/bbot/diagnostics.hxx @@ -129,6 +129,19 @@ namespace bbot r.flush (); throw failed (); }) {} + + // If hard is false, then we fail as an error (but still throw). + // + simple_prologue + operator() (bool hard = true) const + { + if (hard) + return simple_prologue (indent_, epilogue_, type_, name_); + + simple_prologue r (error ()); + r.epilogue = epilogue_; + return r; + } }; using fail_mark = butl::diag_mark<fail_mark_base>; |