diff options
Diffstat (limited to 'src/libutil/error.cc')
-rw-r--r-- | src/libutil/error.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libutil/error.cc b/src/libutil/error.cc index f780aabef..1a294bf08 100644 --- a/src/libutil/error.cc +++ b/src/libutil/error.cc @@ -417,4 +417,17 @@ std::ostream & showErrorInfo(std::ostream & out, const ErrorInfo & einfo, bool s return out; } +void ignoreException(Verbosity lvl) +{ + /* Make sure no exceptions leave this function. + printError() also throws when remote is closed. */ + try { + try { + throw; + } catch (std::exception & e) { + printMsg(lvl, "error (ignored): %1%", e.what()); + } + } catch (...) { } +} + } |