[Zope] Cannot determine exception cause

Mark Gibson mark@kaivo.com
Tue, 04 Jun 2002 14:08:50 -0600

Doug Chamberlin wrote:

> Please help a fledgling Zope user who is trying to build his first Zope 
> site!
> I have a database in which there is a table of "activity groups" which 
> can be obtained from the selectActivityGroups ZSQL. This works fine. The 
> document which produces this page is ListGroups.
>  From ListGroups I can click the Edit button to get toe the EditAGroup 
> page. This also works fine and the selected record's values are 
> transferred correctly. When I click the Save button, the UpdateAGroup 
> document is accessed which, in turn, accesses the UpdateGroup ZSQL. When 
> this is done an error occurs which causes the exception to be raised in 
> UpdateAGroup.
> 1. How can I detect further what the cause of the exception is?
> 2. Why does the error message come out "Error while saving group 
> _['dbid']" instead of translating the dbid value?

I'll answer the easy one.

In the exception below, you should replace the appropriate line with the 

Error while saving group <dtml-var "_['dbid']">. Canges were <b>not</b> 

[stuff deleted]
> <dtml-except>
>   Error while saving group _['dbid']. Canges were <b>not</b> saved.
>   <form action="." method=post>
>     <!-- TODO need to add all hidden fields here again...>
>     <input type="submit" name="EditAGroup:method" value="Try Again">
>     <input type="submit" name="ListGroups:method" value="Return to List">
>     <input type=hidden name="dbid" value="<dtml-var dbid>">
>     <input type=hidden name="shortname" value="<dtml-var newshortname>">
>     <input type=hidden name="longname" value="<dtml-var newlongname>">
>     <input type=hidden name="description" value="<dtml-var 
> newdescription>">
>   </form>
> </dtml-try>
> <dtml-var standard_html_footer>
> ZSQL UpdateGroup (has params of dbid, NewShortName, NewLongName, 
> NewDescription):
> update GroupsOfActivities
> set
>   ShortName=<dtml-sqlvar NewShortName type=string>,
>   LongName=<dtml-sqlvar NewLongName type=string>,
>   Description=<dtml-sqlvar NewDescription type=string>
> where
>   DBID=<dtml-sqlvar dbid type=string>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )