Debugging AJAX requests with the help of Firebug
As mentioned elsewhere, the combination of Firefox and Firebug is very handy for catching problems with your templates, especially javascript issues. And paster's interactive debug response page is especially helpful. But when you have bugs in a controller or a response template during an AJAX request, Firefox can just sit there showing nothing while even paster's logs do not show an error – I suppose because they are still waiting for the request to complete.
In this situation even Firebug will still show the green check-mark indicating "no errors" since there technically has not been an error that its javascript console has seen. But if you poke around, you'll find that paster's interactive debug IS still there, it's just stuck inside the AJAX response text and Firebug doesn't know enough to display it automatically. Here's how to bring it up manually.
Workaround
1. Open Firebug
2. On the Console / HTML / CSS / Script / Dom / Net line, click "Net"
3. On the Inspect line above, click XHR (or sometimes it's under HTML or one of the other tabs, depending on how your project was handling things).
4. The request that got stuck due to some bug should appear in red in Firebug's display, possibly among other items.
5. Click the relevant request in red, and it opens up with tabs for Headers / Post / Response
6. Click Response. There is the interactive debug page you were hoping for, but it's treated as text rather than rendered. You could just scroll through it, ignoring all the CSS and so forth, but instead...
7. Right-click in the response and choose to open it in a new tab. Voila! There's the interactive pylons error page, complete with code inspection and mini command shell. Now you can dig around much more effectively.
Thanks for the article, I've been using this method for a while now and it's a lifesaver.
Sometimes with XHR form submits the Response gets somehow cached and shows the same thing no matter what the error is.
The workaround is to look inside paster's console. When the error occurs it throws something like
http://127.0.0.1:2051/_debug/view/1205740036
You just type it in your browser and get the standart Pylons error screen.
It must be really basic thing, but a lot of people out there know about it.