From f369c711dd8bd6eec6905645dab9a153ebbba0a8 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 3 Nov 2025 15:49:36 +0100 Subject: [PATCH] libutil: prefer reporting libarchive source errors if curl fails during a transfer and said transfer is piped through libarchive we see very strange errors (#1009). in such cases we'll want to prioritize reporting the source errors to allow debugging. Change-Id: I8cc231257eca5b749471ecd38df15071170decc2 --- lix/libutil/compression.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lix/libutil/compression.cc b/lix/libutil/compression.cc index a351dce67..483c6d5b1 100644 --- a/lix/libutil/compression.cc +++ b/lix/libutil/compression.cc @@ -417,7 +417,10 @@ struct DecompressionStream : DecompressorPipes, AsyncInputStream if (const auto got = ::read(uncompressed.readSide.get(), buffer, size); got > 0) { co_return got; } else if (got == 0) { - // decompresser must have finished, poll for any errors and return EOF + if (feedExc) { + std::rethrow_exception(feedExc); + } + // decompresser must have finished, poll for any errors and return EOF. thread.get(); co_return std::nullopt; } else if (errno == EAGAIN || errno == EWOULDBLOCK) {