[zypp-commit] r7228 - /trunk/zypper/src/zypper-misc.cc
Author: dmacvicar Date: Wed Sep 12 23:23:40 2007 New Revision: 7228 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7228&view=rev Log: - catch the right verification exception fro libyzpp. This solves a old hack finding the exception message string to see if it is a verification failed - Don't report failed download packages as bug. Show the right message and history Modified: trunk/zypper/src/zypper-misc.cc Modified: trunk/zypper/src/zypper-misc.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=7228&r1=7227&r2=7228&view=diff ============================================================================== --- trunk/zypper/src/zypper-misc.cc (original) +++ trunk/zypper/src/zypper-misc.cc Wed Sep 12 23:23:40 2007 @@ -11,6 +11,7 @@ #include <zypp/base/Algorithm.h> #include <zypp/solver/detail/Helper.h> #include <zypp/media/MediaException.h> +#include <zypp/FileChecker.h> #include <zypp/RepoManager.h> #include <zypp/RepoInfo.h> @@ -1399,24 +1400,27 @@ _("Please, see the above error message to for a hint.")); return ZYPPER_EXIT_ERR_ZYPP; } - catch ( const Exception & excpt_r ) { - ZYPP_CAUGHT( excpt_r ); - - // special handling for failed integrity exception - //! \todo fix this in libzypp - if (excpt_r.msg().find("fails integrity check") != string::npos) { - cerr << endl - << _("The package integrity check failed. This may be a problem" + catch ( const zypp::repo::RepoException & e ) { + ZYPP_CAUGHT(e); + report_problem(e, + _("Problem downloading the package file from the repository:"), + _("Please, see the above error message to for a hint.")); + return ZYPPER_EXIT_ERR_ZYPP; + } + catch ( const zypp::FileCheckException & e ) { + ZYPP_CAUGHT(e); + report_problem(e, _("The package integrity check failed. This may be a problem" " with the repository or media. Try one of the following:\n" "\n" "- just retry previous command\n" "- refresh the repositories using 'zypper refresh'\n" "- use another installation medium (if e.g. damaged)\n" - "- use another repository") << endl; - return ZYPPER_EXIT_ERR_ZYPP; - } - else - ZYPP_RETHROW( excpt_r ); + "- use another repository")); + return ZYPPER_EXIT_ERR_ZYPP; + } + catch ( const Exception & excpt_r ) { + ZYPP_CAUGHT( excpt_r ); + ZYPP_RETHROW( excpt_r ); } } } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org
participants (1)
-
dmacvicar@svn.opensuse.org