Hi, I have the following snippet in my standard_error_message: <dtml-sendmail mailhost="mail_host"> To: aseem@somain.com From: zope@host.domain.com Subject: Zope Error: <dtml-var error_type> Error Type: <dtml-var error_type> <dtml-var error_tb> -zope </dtml-sendmail> The problem is that the error_tb is sent quoted like in the stuff below. Any ideas why?? Any workarounds?? TIA AM _________________ Error Type: NotFound Traceback: <p>Traceback (innermost last): <ul> <li> Module ZPublisher.Publish, line 89, in publish</li> <li> Module ZPublisher.BaseRequest, line 329, in traverse</li> <li> Module ZPublisher.HTTPResponse, line 636, in debugError</li> </ul>NotFound: <TABLE BORDER="0" WIDTH="100%"> <TR VALIGN="TOP"> <TD WIDTH="10%" ALIGN="CENTER"> </TD> <TD WIDTH="90%"> <H2>Site Error</H2> <P>An error was encountered while publishing this resource. </P> <P><STRONG>Debugging Notice</STRONG></P> Zope has encountered a problem publishing your object.<p> Cannot locate object at: http://nbs.neuro-bs.com/dadada <HR NOSHADE> <P>Troubleshooting Suggestions</P> <UL> <LI>The URL may be incorrect.</LI> <LI>The parameters passed to this resource may be incorrect.</LI> <LI>A resource that this resource relies on may be encountering an error.</LI> </UL> <P>For more detailed information about the error, please refer to the HTML source for this page. </P> <P>If the error persists please contact the site maintainer. Thank you for your patience. </P> </TD></TR> </TABLE> </p> - zope __________________ -- ================================================================== Aseem Mohanty Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231 ================================================================== "I saw `cout' being shifted "Hello world" times to the left and stopped right there!!" -- Steve Gonedes ==================================================================
AM wrote at 2003-3-10 12:03 -0800:
I have the following snippet in my standard_error_message: ... <dtml-sendmail mailhost="mail_host"> ... <dtml-var error_tb> ... </dtml-sendmail>
The problem is that the error_tb is sent quoted like in the stuff below. Any ideas why?? Any workarounds?? .... Error Type: NotFound Traceback:
<p>Traceback (innermost last): <ul>
<li> Module ZPublisher.Publish, line 89, in publish</li>
<li> Module ZPublisher.BaseRequest, line 329, in traverse</li>
<li> Module ZPublisher.HTTPResponse, line 636, in debugError</li>
</ul>
Up to hear, it is as expected: You are sending a plain text email while "error_tb" expects to be incorporated into an HTML context.
NotFound: <TABLE BORDER="0" WIDTH="100%"> <TR VALIGN="TOP">
<TD WIDTH="10%" ALIGN="CENTER"> </TD>
<TD WIDTH="90%"> <H2>Site Error</H2> <P>An error was encountered while publishing this resource. </P> <P><STRONG>Debugging Notice</STRONG></P>
Zope has encountered a problem publishing your object.<p> Cannot locate object at: http://nbs.neuro-bs.com/dadada <HR NOSHADE>
This is caused by the following problem: Usually, "error_value" should be HTML quoted, as it may contain e.g. "<SpecialException instance at 0x3456>" or other non-HTML text. However, some exceptions, e.g. "debugError" put HTML formatted text in "error_value". Of course, quoting this HTML does not enhance readability. I do not have an easy solution. Probably, the exceptions that put HTML into "error_value" should derive from a special exception base class which would allow to treat them in a special way. Or, even better, all exceptions should delegate presentation to "standard_error_message" and do not try to HTML render error text. Dieter
Dieter Maurer wrote:
Or, even better, all exceptions should delegate presentation to "standard_error_message" and do not try to HTML render error text.
Most definately. Code "deep in" that assumes it knows what context it's return value will be rendered in, is buggy. -- Jamie Heilman http://audible.transient.net/~jamie/ "I was in love once -- a Sinclair ZX-81. People said, "No, Holly, she's not for you." She was cheap, she was stupid and she wouldn't load -- well, not for me, anyway." -Holly
participants (3)
-
AM -
Dieter Maurer -
Jamie Heilman