From 54f5611748d23927d93aedb504b0c493c06187c8 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Thu, 21 Mar 2024 23:08:02 +0100 Subject: [PATCH] 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 --- src/libstore/remote-store.cc | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index b85871aee..11f7681c8 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -1076,27 +1076,15 @@ void RemoteStore::ConnectionHandle::withFramedSink(std::functionto, ex); - fun(sink); - sink.flush(); - } - - stderrThread.join(); - if (ex) - std::rethrow_exception(ex); + FramedSink sink((*this)->to, ex); + fun(sink); + sink.flush(); } }