diff --git a/src/libutil/util.cc b/src/libutil/util.cc index cd359cfee..8b317f6a8 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -1358,11 +1358,15 @@ std::string shellEscape(const std::string_view s) void ignoreException() { + /* Make sure no exceptions leave this function. + printError() also throws when remote is closed. */ try { - throw; - } catch (std::exception & e) { - printError("error (ignored): %1%", e.what()); - } + try { + throw; + } catch (std::exception & e) { + printError("error (ignored): %1%", e.what()); + } + } catch (...) { } } bool shouldANSI()