Re: [Zope] How manage error with zsql

2008-12-11 Thread Dieter Maurer
Miguel Beltran R. wrote at 2008-12-9 13:42 -0600: is possible have a general except and inside show what type is? in dtml was dtml-try ... dtml-except type:dtml-var error_type value: dtml-var error_value /dtml-try According to the documentation (-- embedded online documentation (aka Help) --

Re: [Zope] How manage error with zsql

2008-12-09 Thread Dieter Maurer
Miguel Beltran R. wrote at 2008-12-8 21:01 -0600: I trying the next, but not work say invalid syntax (Script (Python), line 11) 2008/12/6 robert rottermann [EMAIL PROTECTED] hi, I think you should write in a python script: try: result = context.insert_data.zsql msg = 'data inserted'

Re: [Zope] How manage error with zsql

2008-12-09 Thread Miguel Beltran R.
Whenever you get exceptions, you should look at the error description in your error_log object (in the Zope Root Folder of the ZMI). There, you can see (in the so called traceback) where the exception has been raised. This is invaluable information. -- Dieter Thanks, another question

Re: [Zope] How manage error with zsql

2008-12-08 Thread Miguel Beltran R.
I trying the next, but not work say invalid syntax (Script (Python), line 11) 2008/12/6 robert rottermann [EMAIL PROTECTED] hi, I think you should write in a python script: try: result = context.insert_data.zsql msg = 'data inserted' except StandardError as e: -- error

Re: [Zope] How manage error with zsql

2008-12-06 Thread robert rottermann
hi, I think you should write in a python script: try: result = context.insert_data.zsql msg = 'data inserted' except ZeroDivisionError: msg = 'ZeroDivisionError occured' return msg and in your tal you write: div tal:content=context/MyPythonscript /div allways try to put

Re: [Zope] How manage error with zsql

2008-12-06 Thread Andreas Jung
*PythonScript at /ceed/finanza/proyecto/error_insertar* *Line 2* Unauthorized: You are not allowed to access 'type' in this context I think this is a know issue and be have a bugreport + patch already for that within the Launchpad bugtracker. However I cant the ticket number

Re: [Zope] How manage error with zsql

2008-12-06 Thread Dieter Maurer
robert rottermann wrote at 2008-12-6 17:15 +0100: I think you should write in a python script: try: result = context.insert_data.zsql I expect (at least) two errors here. context.insert_data() has a chance to work. msg = 'data inserted' except ZeroDivisionError: msg = 'ZeroDivisionError