From: Jan Kupec Date: Thu, 30 Aug 2007 15:31:17 +0000 (+0000) Subject: - remember the cause of the RepoException when refreshing metadata X-Git-Tag: 6.6.0~1716 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=551fc7d742b39069ceee227ab9097a62e75501ff;p=platform%2Fupstream%2Flibzypp.git - remember the cause of the RepoException when refreshing metadata (#301022) --- diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index b43682b47..5589d9d14 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -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); } ////////////////////////////////////////////////////////////////////////////