Jonathan LaCour wrote:
What if my controller method calls another controller method that is also decorated to run inside a transaction? Will the decorator be smart enough to use the current transaction? In the case of a filter-based approach, you could instead start a transaction `onRequestStart`, rollback and display an error message `onRequestError`, and commit `onRequestEnd`.

Unfortunately, CherryPy filters will only allow us to rollback or commit. We can't actually display a meaningful page. I filed a ticket for this #392 with the CherryPy team, but they seem to think it is working correctly. I'll have to write a short example to show exactly what's going wrong.

Basically, whenever an exception was raised, in my case an Identity related exception, I wanted to catch the exception and display an error page. I tried everything I could think of and certainly everything that was documented, but I could never manage to convince CherryPy to do anything other than report a 500 error with a traceback.

Maybe this has been fixed since I tried (which was pre-2.1 release), but I'm guessing I didn't word my ticket specifically enough.

My other ticket (#391) was summarily closed too: I think it's reasonable to raise an InternalRedirect in a filter rather than muck about with the nearly undocumented cherrypy.request.objectPath attribute.


--
Jeff Watkins
http://newburyportion.com/

Reply via email to