[Zope] dtml-try... again?

Ken firerooster@netscape.net
Sat, 23 Nov 2002 00:57:27 +0100 (CET)


If no one minds, I'll repeat my question more clearly:

I am getting Key Errors, possible having to do with some remote HTTP calls. I don't know how to provoke the problem, it 'just happens' (revised estimate) 5-10% of the time.

The Key Error never happens twice, so requesting the page a second time always works. I was tempted to use something like this:

<dtml-try> 
<dtml-var "error_prone_method.view()">
<dtml-except KeyError>
<dtml-call "RESPONSE.redirect(URL)">
</dtml-try>

But I think there is something evil about this which could bring the world as I know it to untimely end...

Now I'm thinking 'Custom Error' as described in zdp.zope.org/projects/zsnippet/snippets/ DTMLContent/CustomError 

1.) Can this be used for a KeyError?
2.) How can I test this by provoking a KeyError?

Thanks to all!

Ken