[Zope] How manage error with zsql

Miguel Beltran R. yourpadre at gmail.com
Mon Dec 8 22:01:53 EST 2008


I trying the next, but not work say " invalid syntax (Script (Python), line
11)"

2008/12/6 robert rottermann <robert at redcor.ch>

> hi,
>
> I think you should  write in a python script:
>
> try:
>  result = context.insert_data.zsql
>  msg = 'data inserted'
> except StandardError as e:             <-- error here
>  msg = 'Error type %s. <br>Value: %s' % (e.type, e.value)
>
> return msg
>
>
If change to


try:
   result=context.proyecto_alta_zsql()
   msg="Se incertaron los datos correctamente"
except StandardError, (e1,e2):
   msg = "Error valor %s y %s" % (e1,e2)
return msg

say
Tipo: Unauthorized
Valor: You are not allowed to access 'a particular str' in this context

(same error with type?)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20081208/6b67b040/attachment.html 


More information about the Zope mailing list