8 Jun
2001
8 Jun
'01
6:23 p.m.
Sion Morris writes:
How do I return a success or failure flag from the ZSQLMethod to DTML Method x? Does the ZSQL Method return anything once it has done it's operation? I know of only a single way, a Z SQL Method can signal failure:
it raises an exception This exception is propagated until it hits an exception handler. There is an exception handler in ZPublisher. It will turn the exception into a 500 HTTP response (internal server error). If you do not like this failure indication, you need to catch the exception earlier. You will need the "try: ... except:..." clause in Python script or the "dtml-try" tag in DTML. See (e.g.) URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html for details. Dieter