You should read the Python docs and learn how exception handling works (see try..except, traceback module etc). And btw. avoid double postings. -aj --On Montag, 26. Mai 2003 23:51 Uhr +0200 Dieter Fischer <dieter.fischer@grid-it.ch> wrote:
Hello
I didn't find the equivalent commands in python (script) for this two dmtl commands:
<dtml-try> ... <dtml-except DatabaseError> <dtml-if "error_type == 'IntegrityError'"> ... </dtml-if> <dtml-else> ... </dtml-try>
---
try: ... except DatabaseError: if error_type == 'IntegrityError': ... else: ...
doesn't work. Have I to import something to access the variables, or what am I missing?
Thanks
Dieter
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )