util.{hh,cc}: Move ignoreException to error.{hh,cc}

Change-Id: Iae6464217a55c313a983e5c651b26a4a1e446706
This commit is contained in:
Tom Hubrecht
2024-05-29 11:42:42 +02:00
parent 8b6d2d3915
commit 93ebb3e7df
5 changed files with 20 additions and 20 deletions
+13
View File
@@ -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 (...) { }
}
}