[Zope] Trapping error messages.
Ethan Fremen
mindlace@majordomo.net
Sat, 02 Oct 1999 19:49:17 +0100
Some folks asked about this a bit ago, so here it is:
first, check out how the zopester's do it:
http://www.zope.org/standard_error_message/view_source
so, there is a variable error_type, and it appears, from the Zope Quick
reference
(look for setStatus) to have the following string values:
OK, Created, Accepted, NoContent, MovedPermanently, MovedTemporarily,
NotModified, BadRequest, Unauthorized, Forbidden, NotFound,
InternalError, NotImplemented, BadGateway, ServiceUnavailable
these may not all be valid values of error_type (I doubt OK is.) anyway,
the ZQR is at http://www.zope.org/Members/ZQR
so, in standard_error_message, you can do a sequence of
<dtml-if "error_type == errorhere">
<dtml-var thisError_response>
<dtml-var standard_html_footer>
<dtml-else>
<dtml-if "error_type == nexterror">
<dtml-var otherError_response>
<dtml-var standard_html_footer>
<dtml-else>
<p>Something is wrong, something is terribly wrong</p>
</dtml-if>
</dtml-if>
--
~mindlace