[Yum-devel] returnNewestByName & PackageSackError's ...
bretm at redhat.com
Wed May 31 20:31:43 UTC 2006
On Wed, 2006-05-31 at 15:49 -0400, seth vidal wrote:
> > _computeAggregate* are really generic; dealing with exceptions for
> > anything non-critical seems impractical... what am I missing? Just
> > seems like returnNewestBy* should be able to return None if there wasn't
> > any match; it doesn't seem to warrant an exception.
> I guess I don't understand what the big deal is about catching the
> exceptions in _computerAggregate*.
> why not just enclose the call in a try, except?
> what's the expense?
No expense, I question the utility. Since _computeAggregate* calls out
to any number of functions on the internal sacks, how can it
meaningfully respond to a generic PackageSackError?
So, the options are either:
a) skip all PackageSackErrors (ick)
b) create a more specific exception, say PackageNotFound, and look
specifically for that in _computeAggregate* and skip it
c) just return None.
If you expect to always return a result from returnNewestBy*, raising an
exception is sane. But with the repos I'm working with, seems like a
pretty frequent occurrence during depsolving to not have the pkg in one
or more sacks.
I guess the question I have is, where is raising this exception useful?
I didn't see anything looking specifically to catch PackageSack errors
yet, is something in the works?
More information about the Yum-devel