diff options
Diffstat (limited to 'src/error-demo/error-demo.cc')
-rw-r--r-- | src/error-demo/error-demo.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/error-demo/error-demo.cc b/src/error-demo/error-demo.cc index 514258416..82b03d71b 100644 --- a/src/error-demo/error-demo.cc +++ b/src/error-demo/error-demo.cc @@ -26,10 +26,13 @@ int main() // ErrorInfo constructor try { - auto e = Error("generic error"); + auto e = Error("some error"); throw DemoError(e.info()); } catch (Error &e) { - logger->logEI(e.info()); + ErrorInfo ei = e.info(); + string prevhint = (e.info().hint.has_value() ? e.info().hint->str() : ""); + ei.hint = std::optional(hintfmt("previous hint was: %s", normaltxt(prevhint))); + logger->logEI(ei); } |