aboutsummaryrefslogtreecommitdiff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 44463161f..9c2e43cdd 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()