diff options
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>; |