On Tue, Sep 7, 2010 at 5:10 PM, Phlip <phlip2...@gmail.com> wrote:
>
> Djangoists:
>
> Under runserver, when I click on an Ajaxy thing on my web site, and
> its handler throws an exception...
>
> ...the console says nothing (in DEBUG = True mode)
>
> ...and Django renders a beautiful HTML exception report
>
> ...and sends this over the wire into my browser
>
> ...who then throws it away because it's not Ajax
>
> ...and I must dig it out with a developer toolkit tool
>
> ...and paste it into a file yo.html
>
> ...and render this in a browser
>
> ...to see the actual error.
>
> I'm probably missing some configuration option, subsidiary to DEBUG
> mode. (v1.2, BTW)
>
> How do I get Ajax errors to print a simple exception trace to STDOUT,
> instead of going through all that baloney?

Use middleware that has a 'process_exception' method defined.
http://docs.djangoproject.com/en/dev/topics/http/middleware/#process_exception

This snippet is simple and does the trick:
http://djangosnippets.org/snippets/420/

-Elijah

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to