Downloader: Propagate exceptions from decompressionSink->finish()

This commit is contained in:
Eelco Dolstra 2019-06-24 21:06:37 +02:00
parent 96c6b08ed7
commit 15fa70cd1b
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -311,8 +311,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)
if (decompressionSink) {
try {
decompressionSink->finish();
} catch (...) {
writeException = std::current_exception();
}
}
if (code == CURLE_WRITE_ERROR && result.etag == request.expectedETag) {
code = CURLE_OK;