Re: [Httplib2-discuss] httplib2 should provide custom exceptions for httplib failures
Status: Beta
Brought to you by:
jcgregorio
From: Joe G. <jo...@bi...> - 2006-12-12 17:41:18
|
On 12/8/06, Simon Willison <si...@si...> wrote: > One solution might be for httplib2 to have two request methods - one > that raises exceptions and one that returns the document with the > non-200 status code. It would be nice if Python had a standard idiom > or naming convention for pairs of methods like this, but it's not > something I've seen anywhere. There might be a good reason for that > of course. I'm thinking of at least making this a switch, on by default, that turns all exceptions into status codes. One of the big reasons for doing do is getting back information on failures. For example, if the number of re-directs exceeds the limit the caller may want to see the chain of response objects when debugging. The best way to accommodate that is to return a response and not throw an exception. This would be a Http property like 'follow_all_redirects'. Thanks, -joe -- Joe Gregorio http://bitworking.org |