diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-21 23:08:02 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-31 14:23:15 +0000 |
commit | 2d3fd6b9abe250ac6758564aecde549357ab5219 (patch) | |
tree | 1a4a0517d2a8eb639134ed367f3b1df1046e6892 /src/libstore/remote-store.cc | |
parent | dd06f9b792638b9c48265b223d095859990d3b26 (diff) |
libstore: using throwing finally in withFramedSink
the duplication of exception handling was added without justification,
so we can only assume that it was done like this because Finally could
not throw exceptions safely. since this has now been rectified we will
deduplicate this handler code again.
Change-Id: I40721f3378c0fd9f34e2914a16d383f6e2713b40
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r-- | src/libstore/remote-store.cc | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 3188d9330..2373bbdc7 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -1067,27 +1067,15 @@ void RemoteStore::ConnectionHandle::withFramedSink(std::function<void(Sink & sin Finally joinStderrThread([&]() { - if (stderrThread.joinable()) { - stderrThread.join(); - if (ex) { - try { - std::rethrow_exception(ex); - } catch (...) { - ignoreException(); - } - } + stderrThread.join(); + if (ex) { + std::rethrow_exception(ex); } }); - { - FramedSink sink((*this)->to, ex); - fun(sink); - sink.flush(); - } - - stderrThread.join(); - if (ex) - std::rethrow_exception(ex); + FramedSink sink((*this)->to, ex); + fun(sink); + sink.flush(); } } |