Use cached result if there is a network error

This commit is contained in:
Eelco Dolstra 2015-04-09 12:49:13 +02:00
parent 1fc905ad4c
commit 4ed2187377
3 changed files with 15 additions and 8 deletions

View file

@ -100,7 +100,7 @@ struct Curl
CURLcode res = curl_easy_perform(curl);
if (res == CURLE_WRITE_ERROR && etag == expectedETag) return false;
if (res != CURLE_OK)
throw Error(format("unable to download %1%: %2% (%3%)")
throw DownloadError(format("unable to download %1%: %2% (%3%)")
% url % curl_easy_strerror(res) % res);
long httpStatus = 0;