Monday, January 31, 2011

Seeing tracebacks of unhandled exceptions in AJAX requests

Hi,

I really like Django's technical error page (the one you get when a view raises an uncaught exception and DEBUG is true). However, when an AJAX request causes an error, the technical error page reaches the AJAX error handler, instead of being displayed in the browser.

To solve this problem, I wrote django-ajaxerrors - simple middleware that is designed to be used when the server is running on the same GUI desktop as the developer is using (as is most commonly the case when developing with the devserver). When an unhandled exception passes through ajaxerrors, a technical error page is generated and a new browser tab is opened, pointing at the error page (using Python stdlib's webbrowser module).

I released django-ajaxerrors under the MIT license; if you're interested, you can see its GitHub page here, its PyPI page here, and a short blog post I published about it here (the blog post includes instructions for downloading a demo site with ajaxerrors installed in it, so you can see if it's useful for you in like 3 minutes).

I hope someone will find it useful, and I'll be happy to hear any comments or address questions.

 - Yaniv

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

No comments:

Post a Comment