[Zope] aborting DTML parsing
Jan Stohner
stohner@drze.de
Mon, 29 Nov 1999 09:52:11 +0100
Hello,
Michel Pelletier wrote:
> > -----Original Message-----
> > From: Jan Stohner [mailto:stohner@drze.de]
> > I am searching for a method to stop rendering at all, no
> > matter how deep
> > method calls are nested (a "return" would now stop rendering of the
> > complete document).
> > Is there a quick solution? I had the idea to implement a
> > <dtml-quit> tag
> > which is similar to <dtml-return> but raises a different
> > exception, but i
> > wasn't able to find the right place in the sources to catch
> > this exception.
>
> Just raise an error way down deep, and catch it at the higher method
> with <dtml-try> and <dtml-except>. I think these tags were added in
> 2.0.0
This is a solution, but i have to modify all my DTML documents. All
documents are beginning with "<dtml-var standard_html_header>" and i COULD
change all documents to "<dtml-try><dtml-var
standard_html_header>....<dtml-except>...", but this is not my preferred
solution.
What about raising an error in a DTML document, but catching it in the Zope
sources? Is this possible, and where do i catch the exception?
Jan
--
Dipl.-Inform. Jan Stohner ------------------ stohner@drze.de
Deutsches Referenzzentrum für Ethik in den Biowissenschaften
Niebuhrstraße 53 -- D-53113 Bonn -- Telefon: +49 228/73-1932