lib/fetcher-curl: Prefix fatal errors with full URL
authorJonathan Lebon <jonathan@jlebon.com>
Fri, 21 Sep 2018 16:31:57 +0000 (12:31 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 21 Sep 2018 18:43:09 +0000 (18:43 +0000)
Just include the whole URL that failed if libcurl failed with something
elementary like CURLE_COULDNT_CONNECT or CURLE_COULDNT_RESOLVE_HOST.

Closes: #1731
Closes: #1732
Approved by: cgwalters

src/libostree/ostree-fetcher-curl.c

index 2583143e05ce8a7ea4af8a21d98308f8afba2421..9738f9808c051f7f9454fe4aca5e6d3324f7780b 100644 (file)
@@ -322,13 +322,12 @@ check_multi_info (OstreeFetcher *fetcher)
             {
               /* Handle file not found */
               g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
-                                       "%s",
-                                         curl_easy_strerror (curlres));
+                                       "%s", curl_easy_strerror (curlres));
             }
           else
             {
-              g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "[%u] %s",
-                                       curlres,
+              g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
+                                       "While fetching %s: [%u] %s", eff_url, curlres,
                                        curl_easy_strerror (curlres));
               _ostree_fetcher_journal_failure (req->fetcher->remote_name,
                                                eff_url, curl_easy_strerror (curlres));