mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
Show HTTP error codes
This commit is contained in:
parent
f294623d1d
commit
9204ea7294
1 changed files with 6 additions and 2 deletions
|
@ -195,7 +195,11 @@ struct CurlDownloader : public Downloader
|
||||||
Error err =
|
Error err =
|
||||||
httpStatus == 404 ? NotFound :
|
httpStatus == 404 ? NotFound :
|
||||||
httpStatus == 403 ? Forbidden : Misc;
|
httpStatus == 403 ? Forbidden : Misc;
|
||||||
throw DownloadError(err, format("unable to download ‘%1%’: %2% (%3%)")
|
if (res == CURLE_HTTP_RETURNED_ERROR && httpStatus != -1)
|
||||||
|
throw DownloadError(err, format("unable to download ‘%s’: HTTP error %d")
|
||||||
|
% url % httpStatus);
|
||||||
|
else
|
||||||
|
throw DownloadError(err, format("unable to download ‘%s’: %s (%d)")
|
||||||
% url % curl_easy_strerror(res) % res);
|
% url % curl_easy_strerror(res) % res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue