RE: [Zope] Traceback?
-----Original Message----- From: Chris Withers [mailto:chrisw@nipltd.com] Sent: 29 May 2000 14:01 To: Martijn Pieters Cc: Patrick J.M. Keane; zope@zope.org Subject: Re: [Zope] Traceback?
Martijn Pieters wrote:
If you switch debug mode off, tracebacks will be included in error messages as HTML comments, thus rendering them invisible from the unsuspecting site visitor.
Is that true even if you override standard_error_message?
I believe so, and empiracally this appears to be the case. From HTTPResponse.py: def _traceback(self,t,v,tb): tb=self.format_exception(t,v,tb,200) tb=join(tb,'\n') tb=self.quoteHTML(tb) if self.debug_mode: _tbopen, _tbclose = '<PRE>', '</PRE>' else: _tbopen, _tbclose = '<!--', '-->' return "\n%s\n%s\n%s" % (_tbopen, tb, _tbclose) which is appended to the body of the error message when an exception occurs. hth, -- Marcus
Hi, Marcus Collins wrote:
-----Original Message----- From: Chris Withers [mailto:chrisw@nipltd.com] Sent: 29 May 2000 14:01 To: Martijn Pieters Cc: Patrick J.M. Keane; zope@zope.org Subject: Re: [Zope] Traceback?
Martijn Pieters wrote:
If you switch debug mode off, tracebacks will be included in error messages as HTML comments, thus rendering them invisible from the unsuspecting site visitor.
Is that true even if you override standard_error_message?
I believe so, and empiracally this appears to be the case. From HTTPResponse.py:
def _traceback(self,t,v,tb): tb=self.format_exception(t,v,tb,200) tb=join(tb,'\n') tb=self.quoteHTML(tb) if self.debug_mode: _tbopen, _tbclose = '<PRE>', '</PRE>' else: _tbopen, _tbclose = '<!--', '-->' return "\n%s\n%s\n%s" % (_tbopen, tb, _tbclose)
which is appended to the body of the error message when an exception occurs.
This is very ugly imho. It schould be sufficient, if one includes the traceback-variable into the standard-error where its appropriate. In the current implementation it will break the HTML-standard with code outside <HTML></HTML> and additionally makes it impossible to get error-messages to picky browsers, such as WAP-devices. Is it ok if we remove these lines? Do I have to copy this message to the collector and wait for a couple of months or can we do it instantly? ;-) Regards Tino Wildenhain
Tino Wildenhain wrote:
Do I have to copy this message to the collector and wait for a couple of months or can we do it instantly? ;-)
Do both, that way, hopefully the change will make it into 2.2 and you get your problem fixed now. I always thought the line <dtml-var error_tb> was included in the standard_error_message and I'm a bit surprised that it's actually such a nasty hack that doesn't produce correct HTML :( cheers, Chris
participants (3)
-
Chris Withers -
Marcus Collins -
Tino Wildenhain