[Zope] standard_error using zpt

Jeff Peterson jeff.peterson at crary.com
Fri Oct 31 10:43:14 EDT 2008


Yeah, I guess I wouldn't expect that to work.  Do you have the full traceback?

 The standard_error_message template can be tricky.  It doesn't get called to handle every error, nor should you call it directly, I think.  AFAIK the "options" data is only available when an error, one that it handles by default, occurs.  Also, and I may be wrong I haven't played with it too much but isn't the name standard_error_message required?  I think what you want to look at is the Zope help for "tal:on-error"  There is an example there that may help.
--
Jeffrey D Peterson
Webmaster
Crary Industries, Inc.

From: Miguel Beltran R. [mailto:yourpadre at gmail.com]
Sent: Thursday, October 30, 2008 9:43 PM
To: Jeff Peterson
Cc: Andrew Milton; zope at zope.org
Subject: Re: [Zope] standard_error using zpt

Not work :(, say

Error Type: TraversalError
Error Value: ({'args': ()}, 'error_type')

::::::::::::: /a/b/muestra.pt<http://muestra.pt>
<div
   tal:condition="exists:request/modo"
   tal:on-error="structure context/standard_error.pt<http://standard_error.pt>"
>
   <p
      tal:condition="python:request.modo=='nada'"
      tal:omit-tag=""
   >
      No se a ejecutado ninguna accion
   </p>
   <p
      tal:condition="python:request.modo=='ultimos'"
      tal:content="structure container/muestra_ultimos.pt<http://muestra_ultimos.pt>"
      tal:omit-tag=""
   >
   </p>
</div>

::::::::: /a/b/muestra_ultimos.pt<http://muestra_ultimos.pt>
<table border="1">
  <thead>
  <tr>
     <th>Tipo</th>
     <th>Producto</th>
     <th>Nombre</th>
     <th>Presentacion</th>
     <th>Unidad</th>
     <th>Existencia</th>
     <th>Total</th>
     <th>Observaciones</th>
  <tr>
  </thead>
  <tbody>
  <tr id="tr"
     tal:repeat="item context/zsql_producto"
     tal:attributes="id python: 'tr_' + repeat.number" <--here is the error what I want catch (how resolve?)
  >
     <td tal:content="item/tipo_producto">Tipo</td>
  </tr>
  </tbody>
</table>


::::::::::::: /standard_error.pt<http://standard_error.pt>
<table>
   <tr>
      <th>Tipo</th> <td tal:content="options/error_type ">TipoError</td>
      <th>Valor</th> <td tal:content="options/error_value ">ValorError</td>
      <th></th> <td tal:content="options/error_tb ">tb</td>
      <th></th> <td tal:content="options/error_traceback ">Raestro en reversa</td>
      <th></th> <td tal:content="options/error_message">mensaje de error</td>
      <th></th> <td tal:content="options/error_log_url">url de error</td>
   </tr>
</table>
2008/10/30 Jeff Peterson <jeff.peterson at crary.com<mailto:jeff.peterson at crary.com>>
Just for independent confirmation he's right, "options" is what you want.

--
Jeffrey D Peterson
Webmaster
Crary Industries, Inc.

-----Original Message-----
From: zope-bounces at zope.org<mailto:zope-bounces at zope.org> [mailto:zope-bounces at zope.org<mailto:zope-bounces at zope.org>] On Behalf Of Andrew Milton
Sent: Wednesday, October 29, 2008 11:02 PM
To: Miguel Beltran R.
Cc: zope at zope.org<mailto:zope at zope.org>
Subject: Re: [Zope] standard_error using zpt

+-------[ Miguel Beltran R. ]----------------------
| Hi List
|
| I remember what old versions from zope haved standard_error using DTML
| How can do it the same using ZPT?
|
| I already try:
| <td tal:content="error/type">
| <td tal:content="python: error.type">
| <td tal:content="context/error/type">

>From memory the following should be available;

options/error_type
options/error_value
options/error_tb
options/error_traceback
options/error_message
options/error_log_url


--
Andrew Milton
akm at theinternet.com.au<mailto:akm at theinternet.com.au>
_______________________________________________
Zope maillist  -  Zope at zope.org<mailto:Zope at 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 )



--
________________________________________
Lo bueno de vivir un dia mas
es saber que nos queda un dia menos de vida
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20081031/7271e7cd/attachment.html 


More information about the Zope mailing list