Ian Bicking wrote:
Bob Ippolito wrote:

They probably use cgitb[1] from standard python distribution. It could be
nice to integrate it to TG too...



What we should do is this:
http://blog.ianbicking.org/ajaxy-exception-catching.html


This will require some WSGIish work on CherryPy to be doable, I think.

Actually, I should amend that -- even though CherryPy's WSGI support is limited, using this middleware should be doable now if you set up the stack manually, *and* if you get CherryPy to not catch any exceptions (I assume there's a way to do that for unit testing anyway). It's not what I'd like it to be, but for this case it would probably work fine. Wrapping the WSGI application should be pretty straight-forward, just:

  from paste.evalexception.middleware import EvalException
  wsgiApp = makeCherryPyApp(...)
  wrappedApp = EvalException(wsgiApp)

And make sure you aren't catching exceptions in the CherryPy layer, and then serve up wrappedApp.

--
Ian Bicking  |  [EMAIL PROTECTED]  |  http://blog.ianbicking.org

Reply via email to