Correctly report a download failiure for 404s
Currently when caling alpm_trans_commit, if fetching a package restults in a 404 (or other non 400 response code), the function returns -1 but errno is never set. This patch sets errno to ALPM_ERR_RETRIEVE. Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
796c02af4c
commit
0e67ee55bd
1 changed files with 1 additions and 0 deletions
|
@ -454,6 +454,7 @@ static int curl_download_internal(struct dload_payload *payload,
|
||||||
if(payload->respcode >= 400) {
|
if(payload->respcode >= 400) {
|
||||||
payload->unlink_on_fail = 1;
|
payload->unlink_on_fail = 1;
|
||||||
if(!payload->errors_ok) {
|
if(!payload->errors_ok) {
|
||||||
|
handle->pm_errno = ALPM_ERR_RETRIEVE;
|
||||||
/* non-translated message is same as libcurl */
|
/* non-translated message is same as libcurl */
|
||||||
snprintf(error_buffer, sizeof(error_buffer),
|
snprintf(error_buffer, sizeof(error_buffer),
|
||||||
"The requested URL returned error: %ld", payload->respcode);
|
"The requested URL returned error: %ld", payload->respcode);
|
||||||
|
|
Loading…
Add table
Reference in a new issue