Author: jkupec Date: Mon Jul 30 16:52:47 2007 New Revision: 6298 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6298&view=rev Log: - fixed proper error message if a repo is invalid (#294483) Modified: trunk/zypper/src/zypper-misc.cc trunk/zypper/src/zypper-sources.cc Modified: trunk/zypper/src/zypper-misc.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=6298&r1=6297&r2=6298&view=diff ============================================================================== --- trunk/zypper/src/zypper-misc.cc (original) +++ trunk/zypper/src/zypper-misc.cc Mon Jul 30 16:52:47 2007 @@ -472,6 +472,7 @@ it != gData.repos.end(); ++it) { RepoInfo repo(*it); + MIL << "Loading " << repo.alias() << " resolvables." << endl; if (! it->enabled()) continue; // #217297 @@ -499,10 +500,14 @@ repository = manager.createFromCache(repo); ResStore store = repository.resolvables(); - cout_v << " " << format(_("(%d resolvables found)")) % store.size(); + cout_v << " " << format(_("(%d resolvables found)")) % store.size() << endl; God->addResolvables(store); } + catch (const repo::RepoMetadataException & ex) + { + cerr << _("asdf") << endl; + } catch (const Exception & e) { ZYPP_CAUGHT(e); Modified: trunk/zypper/src/zypper-sources.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-sources.cc?rev=6298&r1=6297&r2=6298&view=diff ============================================================================== --- trunk/zypper/src/zypper-sources.cc (original) +++ trunk/zypper/src/zypper-sources.cc Mon Jul 30 16:52:47 2007 @@ -37,17 +37,34 @@ it != gData.repos.end(); ++it) { RepoInfo repo(*it); + MIL << "initializing " << repo.alias() << endl; //! \todo honor command line options/commands bool do_refresh = repo.enabled() && repo.autorefresh(); if (do_refresh) { - //! \todo progress reporting cout_v << format( _("Checking whether to refresh metadata for %s.")) % repo.alias() << endl; - manager.refreshMetadata(repo); + MIL << "calling refresh for " << repo.alias() << endl; + + try { manager.refreshMetadata(repo); } + catch (const RepoException & ex) + { + cerr << format(_("Repository %s is invalid.")) % repo.alias() << endl; + cerr_v << _("Reason: ") << ex.asUserString() << endl; + ERR << repo.alias() << " is invalid, disabling it" << endl; + it->setEnabled(false); + } + catch (const Exception & ex) + { + cerr << format(_("Error while refreshing repository %s:")) % repo.alias() + << endl; + cerr << ex.asUserString() << endl; + ERR << "Error while refreshing " << repo.alias() << ", disabling it" << endl; + it->setEnabled(false); + } } } } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org