- remember the cause of the RepoException when refreshing metadata
authorJan Kupec <jkupec@suse.cz>
Thu, 30 Aug 2007 15:31:17 +0000 (15:31 +0000)
committerJan Kupec <jkupec@suse.cz>
Thu, 30 Aug 2007 15:31:17 +0000 (15:31 +0000)
  (#301022)

zypp/RepoManager.cc

index b43682b..5589d9d 100644 (file)
@@ -517,6 +517,9 @@ namespace zypp
     assert_alias(info);
     assert_urls(info);
 
+    // we will throw this later if no URL checks out fine
+    RepoException rexception(_("Valid metadata not found at specified URL(s)"));
+
     // try urls one by one
     for ( RepoInfo::urls_const_iterator it = info.baseUrlsBegin(); it != info.baseUrlsEnd(); ++it )
     {
@@ -608,10 +611,16 @@ namespace zypp
       {
         ZYPP_CAUGHT(e);
         ERR << "Trying another url..." << endl;
+        
+        // remember the exception caught for the *first URL*
+        // if all other URLs fail, the rexception will be thrown with the
+        // cause of the problem of the first URL remembered
+        if (it == info.baseUrlsBegin())
+          rexception.remember(e);
       }
     } // for every url
     ERR << "No more urls..." << endl;
-    ZYPP_THROW(RepoException(_("Valid metadata not found at specified URL(s)")));
+    ZYPP_THROW(rexception);
   }
 
   ////////////////////////////////////////////////////////////////////////////