[Yum-devel] [UG] RFE for ulrgrabber - print url when 404

Seth Vidal skvidal at fedoraproject.org
Mon Apr 27 19:54:40 UTC 2009



On Mon, 9 Feb 2009, Jesse Keating wrote:

> I'm using urlgrabber to watch some repos for changes, and during my
> development I got a few 404s.  This is good because I'm using urlgrabber
> so that it'll actually error on 404, rather than output the 404 headers.
> However in the traceback the url that was 404d isn't printed, and in pdb
> it seemed rather difficult to coax that information out of the place
> where the traceback happened.
>
> Can the url be printed along with the 404 error?  This would probably be
> useful for other such errors.

so I was going through old email and I found this.

I went looking around in urlgrabber and it just simply isn't there. The 
url is available it's just never appended to the exception message.

So my questions are:

1. if you know the url you are calling out to, why do you need it in the 
exception?
2. is this is a situation where you're packing a mirrorgrabber and you 
need to know which mirror is emitting the error?
3. is it good enough to just have this info in the error message results?

There are two ways I can think of doing this:

1. put it in the error message results - ugly in terms of it potentially 
being A LOT of text but trivial to do in the code
2. adding a .url attribute to the exception we're creating so we can 
always refer to that url from any exception easily enough.

In terms of getting ahold of the problem I like #2 but in terms of not 
making everyone write different code I like #1.

There is, of course, nothing prevening both 1 and 2.

-sv



More information about the Yum-devel mailing list