I tried to insert data using an zsql, insert fine How manage error with zsql. <br>Before <br>&lt;dtml-try&gt;<br>&nbsp;&nbsp; &lt;dtml-call insert_data&gt;<br>&nbsp;&nbsp; Data inserted!!!<br>&lt;dtml-except&gt;<br>&nbsp;&nbsp; Error type:&lt;dtml-var error_type&gt;<br>
&nbsp;&nbsp; Error type:&lt;dtml-var error_value&gt;<br>
&lt;/dtml-try&gt;<br><br><br><br>Now (All files are ZPT)<br><br>[index_html]<br>...<br>&lt;form action=&quot;proyecto_alta.html&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &lt;input type=&quot;text&quot; name=&quot;field1&quot; id=&quot;field1&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; &lt;input type=&quot;text&quot; name=&quot;field2&quot; id=&quot;field2&quot; /&gt;<br>&lt;/form&gt;<br><br><br>[proyecto_alta.html]<br>&lt;div tal:on-error=&quot;structure here/error_insertar&quot;&gt;<br>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:condition=&quot;context/insert_data.zsql&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tal:content=&quot;string: Data inserted!!!&quot;&gt;<br><div id=":1t3" class="ArwC7c ckChnd">  <br>&lt;/div&gt;<br></div><br><br>[error_insertar]<br>error=_[&#39;error&#39;]<br>
if error.type==ZeroDivisionError:<br>&nbsp;&nbsp;&nbsp; return &quot;&lt;p&gt;Can&#39;t divide by zero.&lt;/p&gt;&quot;<br>else:<br>&nbsp;&nbsp;&nbsp; return &quot;&quot;&quot;&lt;p&gt;An error ocurred.&lt;/p&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;Error type: %s&lt;/p&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p&gt;Error value: %s&lt;/p&gt;&quot;&quot;&quot; % (error.type,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error.value)<br>
<br><br clear="all">But say<br><div id=":1t3" class="ArwC7c ckChnd"><font color="#888888"><br></font><table border="1"><tbody><tr><th>Tipo</th> <td>Unauthorized</td>
   </tr>
   <tr>
      <th>Valor</th> <td>You are not allowed to access &#39;type&#39; in this context</td>
   </tr>
   <tr>
      <th>TraceBack</th> <td><p>Traceback (innermost last):
</p><ul><li>  Module ZPublisher.Publish, line 119, in publish</li><li>  Module ZPublisher.mapply, line 88, in mapply</li><li>  Module ZPublisher.Publish, line 42, in call_object</li><li>  Module Shared.DC.Scripts.Bindings, line 313, in __call__</li>
<li>  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec</li><li>  Module Products.PageTemplates.ZopePageTemplate, line 330, in _exec</li><li>  Module Products.PageTemplates.ZopePageTemplate, line 427, in pt_render</li>
<li>  Module Products.PageTemplates.PageTemplate, line 96, in pt_render</li><li>  Module zope.pagetemplate.pagetemplate, line 115, in pt_render</li><li>  Module zope.tal.talinterpreter, line 271, in __call__</li><li>  Module zope.tal.talinterpreter, line 346, in interpret</li>
<li>  Module zope.tal.talinterpreter, line 981, in do_onError_tal</li><li>  Module zope.tal.talinterpreter, line 346, in interpret</li><li>  Module zope.tal.talinterpreter, line 745, in do_insertStructure_tal</li><li>  Module Products.PageTemplates.Expressions, line 199, in evaluateStructure</li>
<li>  Module zope.tales.tales, line 696, in evaluate<br>
<b>URL: /ceed/finanza/proyecto/proyecto_alta.html</b><br>
<b>Line 1, Column 0</b><br>
<b>Expression: &lt;PathExpr standard:u&#39;here/error_insertar&#39;&gt;</b><br>
<b>Names:</b><pre>{&#39;container&#39;: &lt;Folder at /ceed/finanza/proyecto&gt;,<br> &#39;context&#39;: &lt;Folder at /ceed/finanza/proyecto&gt;,<br> &#39;default&#39;: &lt;object object at 0x0075A528&gt;,<br> &#39;here&#39;: &lt;Folder at /ceed/finanza/proyecto&gt;,<br>
 &#39;loop&#39;: {},<br> &#39;nothing&#39;: None,<br> &#39;options&#39;: {&#39;args&#39;: ()},<br> &#39;repeat&#39;: &lt;Products.PageTemplates.Expressions.SafeMapping object at 0x02382828&gt;,<br> &#39;request&#39;: &lt;HTTPRequest, URL=<a href="http://sic/finanza/proyecto/proyecto_alta.html">http://sic/finanza/proyecto/proyecto_alta.html</a>&gt;,<br>
 &#39;root&#39;: &lt;Application at &gt;,<br> &#39;template&#39;: &lt;ZopePageTemplate at /ceed/finanza/proyecto/proyecto_alta.html&gt;,<br> &#39;traverse_subpath&#39;: [],<br> &#39;user&#39;: &lt;User &#39;admin&#39;&gt;}</pre>
</li><li>  Module zope.tales.expressions, line 217, in __call__</li><li>  Module Products.PageTemplates.Expressions, line 139, in _eval</li><li>  Module Products.PageTemplates.Expressions, line 91, in render</li><li>  Module Products.PageTemplates.ZRPythonExpr, line 79, in call_with_ns</li>
<li>  Module Shared.DC.Scripts.Bindings, line 327, in __render_with_namespace__</li><li>  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec</li><li>  Module Products.PythonScripts.PythonScript, line 327, in _exec</li>
<li>  Module None, line 2, in error_insertar<br>
<b>&lt;PythonScript at /ceed/finanza/proyecto/error_insertar&gt;</b><br>
<b>Line 2</b></li></ul>Unauthorized: You are not allowed to access &#39;type&#39; in this context
</td></tr></tbody></table><br></div><br><a href="http://www.plope.com/Books/2_7Edition/AppendixC.stx#2-28" target="_blank">(Example taked from http://www.plope.com/Books/2_7Edition/AppendixC.stx#2-28</a>)<br>
<font color="#888888"><br></font><br>-- <br>________________________________________<br>Lo bueno de vivir un dia mas<br>es saber que nos queda un dia menos de vida<br>