about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-06-24T19·06+0200
committerEelco Dolstra <edolstra@gmail.com>2019-06-24T19·59+0200
commit2fef4dd29673ef383b695480c9b8212f2e8d4711 (patch)
treee0631cb0aeb58014374d3df9ccb371718da77a65
parentb43e1e186e50bedc30d05d063dffbd751c1ff161 (diff)
Downloader: Propagate exceptions from decompressionSink->finish()
(cherry picked from commit 15fa70cd1b853f5e62662b99ccb9ef3da6cfadff)
-rw-r--r--src/libstore/download.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 975cfd97d303..8e94646d49ac 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -327,8 +327,13 @@ struct CurlDownloader : public Downloader
             debug("finished %s of '%s'; curl status = %d, HTTP status = %d, body = %d bytes",
                 request.verb(), request.uri, code, httpStatus, result.bodySize);
 
-            if (decompressionSink)
-                decompressionSink->finish();
+            if (decompressionSink) {
+                try {
+                    decompressionSink->finish();
+                } catch (...) {
+                    writeException = std::current_exception();
+                }
+            }
 
             if (code == CURLE_WRITE_ERROR && result.etag == request.expectedETag) {
                 code = CURLE_OK;