[Zope] standard_error_message - displaying non html content

Noel Duffy noel.duffy@propylon.com
Fri, 12 Oct 2001 11:23:57 +0100


I have a zope site where users can access content using either
html browsers or wap/wml devices. I want to customize the
standard_error_message dtml document to display errors in
the appropriate format for each user. For example, if a user
tries to access a non-existent url from a wml browser, they
should get a nice wml page back saying that the page was not
found. 

Heres the problem. Although I have customized standard_error_message
to display a page in the right format, the code in
ZPublisher/HTTPResponse.py (exception method of HTTPResponse class)
checks the error page I generate and, if it doesn't see "<html>" or
"<!doctype html" at the start of the page, it wraps my page in some
html by calling _error_html. Thus I get a small wml page wrapped in
html :-( It makes no difference what the content-type header is set to
- I'm setting that correctly for the users browser.

Is there any way I can alter this behaviour short of changing
the code in ZPublisher/HTTPResponse.py? 

Thanks in advance

Noel Duffy.