Blame SOURCES/0032-Add-more-specific-error-handling-for-loading-repomd-.patch

1a8671
From b636af779fcdab326eef7bbb74912254c2fa2b0c Mon Sep 17 00:00:00 2001
1a8671
From: =?UTF-8?q?Ale=C5=A1=20Mat=C4=9Bj?= <amatej@redhat.com>
1a8671
Date: Thu, 17 Mar 2022 10:34:24 +0100
1a8671
Subject: [PATCH 32/34] Add more specific error handling for loading repomd and
1a8671
 primary
1a8671
1a8671
---
1a8671
 libdnf/dnf-sack.cpp | 19 +++++++++++++++----
1a8671
 1 file changed, 15 insertions(+), 4 deletions(-)
1a8671
1a8671
diff --git a/libdnf/dnf-sack.cpp b/libdnf/dnf-sack.cpp
1a8671
index 61f4807c..8e11b8f8 100644
1a8671
--- a/libdnf/dnf-sack.cpp
1a8671
+++ b/libdnf/dnf-sack.cpp
1a8671
@@ -780,13 +780,24 @@ load_yum_repo(DnfSack *sack, HyRepo hrepo, GError **error)
1a8671
         fp_primary = solv_xfopen(primary.c_str(), "r");
1a8671
         assert(fp_primary);
1a8671
 
1a8671
-        g_debug("fetching %s", name);
1a8671
-        if (repo_add_repomdxml(repo, fp_repomd, 0) || \
1a8671
-            repo_add_rpmmd(repo, fp_primary, 0, 0)) {
1a8671
+        g_debug("Loading repomd: %s", fn_repomd);
1a8671
+        if (repo_add_repomdxml(repo, fp_repomd, 0)) {
1a8671
             g_set_error (error,
1a8671
                          DNF_ERROR,
1a8671
                          DNF_ERROR_INTERNAL_ERROR,
1a8671
-                         _("repo_add_repomdxml/rpmmd() has failed."));
1a8671
+                         _("Loading repomd has failed: %s"),
1a8671
+                         pool_errstr(repo->pool));
1a8671
+            retval = FALSE;
1a8671
+            goto out;
1a8671
+        }
1a8671
+
1a8671
+        g_debug("Loading primary: %s", primary.c_str());
1a8671
+        if (repo_add_rpmmd(repo, fp_primary, 0, 0)) {
1a8671
+            g_set_error (error,
1a8671
+                         DNF_ERROR,
1a8671
+                         DNF_ERROR_INTERNAL_ERROR,
1a8671
+                         _("Loading primary has failed: %s"),
1a8671
+                         pool_errstr(repo->pool));
1a8671
             retval = FALSE;
1a8671
             goto out;
1a8671
         }
1a8671
-- 
1a8671
2.31.1
1a8671