Ian Bicking: the old part of his blog

Ajaxy Exception Catching

I added a new WSGI middleware to Paste this weekend, in paste.evalexception:EvalException <http://svn.pythonpaste.org/Paste/trunk/paste/evalexception/> (or just egg:Paste#evalerror if you are using paste.deploy). This adds to exception reports, allowing you to inspect and evaluate code in the context of individual frames of the traceback. Like everything in Paste, this can be applied to any WSGI application/framework.

Since I can't give a live online demo -- since this specifically allows you to evaluate arbitrary code -- I thought I'd try a screencast. My first screencast!

Go view the screencast.

Since people are always curious, this was created with pyvnc2swf, and I recorded the audio track separately and then merged (with the included edit.py).

Created 07 Nov '05



# Ned Batchelder

Great stuff, Ian!

# Kevin Dangoor

Very cool demo - I will definitely check it out sometime.

Re the screencast itself - I think a few pauses (of a second or two) would help break it up into sections -- a bit like paragraphs vs a single long piece of running text.

# Mark Russell

Ian, All I can say is "WOW". The screencast worked great too.

# anonymous


But why just for exceptions in wsgi apps? I'd like ALL my Python interaction to work like that! The web browser is the new tty. This is what the Python interactive interpreter should look like.

# Oren Tirosh

pdb is like this, but a bunch of other stuff. Personally I think this part (inspecting frames) is the most interesting part, and pdb is complex enough that it's not easy to use it just for this. Also inspecting frames is relatively easy (from a programming point of view). This is definitely something inside the scope of, say, ipython. WinPDB looks more accessible, though.

# Ian Bicking

I'm not talking about yet another python-interactive-interpreter-in-a-GUI-window. Dynamic HTML is text taken to the next step in its evolution. Imagine typing an expression at the familiar '>>>' prompt and getting an active explorable HTML representation of the resulting object. The text content of the HTML would be exactly the same as the standard repr - but it's alive.

# Oren T