On Jan 30, 2011, at 4:39 PM, Art Zemon wrote:
> I had a heckuva time this afternoon debugging this code:
> # request.extension == 'json'
> location = URL(...)
> return dict(location=location)
> I get getting HTTP 405 errors. It turns out that generic.json uses a 
> try/except block and thows an HTTP 405 error on any exception. The real error 
> is that location is not serializable but OY VEY that was tough to figure out. 
> (All I had to do was convert location to a string and all was well.) Is there 
> some debugging fu that I am missing?

Did you see the "no json" message as well (just curious)?

Seems to me that generic.json ought to, at the very least, be more specific 
about this kind of exception. Blanket try/excepts are always asking for trouble.

Reply via email to