[packagekit] Reviewing use of internal-error
Robin Norwood
rnorwood at redhat.com
Mon Mar 24 12:55:06 PDT 2008
On Mon, 24 Mar 2008 17:32:06 +0000
Richard Hughes <hughsient at gmail.com> wrote:
> Guys, we shouldn't be using internal-error at all:
>
> Error Type: <class 'yum.Errors.RepoError'>
> Error Value: Cannot retrieve repository metadata (repomd.xml) for
> repository: utopia. Please verify its path and try again
> File : /usr/share/PackageKit/helpers/yum/get-updates.py , line 19, in
> <module> backend.get_updates(filter)
> File : /usr/share/PackageKit/helpers/yum/yumBackend.py , line 1075,
> in get_updates self._refresh_yum_cache()
> File : /usr/share/PackageKit/helpers/yum/yumBackend.py , line 1237,
> in _refresh_yum_cache
> self.yumbase.repos.populateSack(mdtype='metadata', cacheonly=1)
> File : /usr/lib/python2.5/site-packages/yum/repos.py , line 244, in
> populateSack sack.populate(repo, mdtype, callback, cacheonly)
> File : /usr/lib/python2.5/site-packages/yum/yumRepo.py , line 149, in
> populate if self._check_db_version(repo, mydbtype):
> File : /usr/lib/python2.5/site-packages/yum/yumRepo.py , line 203, in
> _check_db_version return repo._check_db_version(mdtype)
> File : /usr/lib/python2.5/site-packages/yum/yumRepo.py , line 911, in
> _check_db_version repoXML = self.repoXML
> File : /usr/lib/python2.5/site-packages/yum/yumRepo.py , line 1057,
> in <lambda> repoXML = property(fget=lambda self: self._getRepoXML(),
> File : /usr/lib/python2.5/site-packages/yum/yumRepo.py , line 1053,
> in _getRepoXML raise Errors.RepoError, msg
>
> In this case we should emit an error PK_ERROR_ENUM_FAILED_TO_DOWNLOAD
> metadata so we can tell the user what is going on rather than
> "Internal error".
>
> If you give me a list of enums to add, I'll do them as quick as you
> like :-)
By the by, looking at the error enums we have, a few of them don't seem
to be used by any backend. At least these two so far:
{PK_ERROR_ENUM_FAILED_INITIALIZATION, "failed-initialization"},
{PK_ERROR_ENUM_FAILED_FINALISE, "failed-finalise"},
They're pretty vague, and leave one wondering 'why' the backend failed
to initialize or finalise - any why 'finalize' is spelled with an 's'.
I'll probably remove them unless someone complains.
-RN
--
Robin Norwood
Red Hat, Inc.
"The Sage does nothing, yet nothing remains undone."
-Lao Tzu, Te Tao Ching
More information about the PackageKit
mailing list