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
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Ken Sent: Friday, November 22, 2002 3:57 PM To: zope@zope.org Subject: re: [Zope] dtml-try... again?
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>
I hate to be critical here but this is a bad, bad idea. You're creating an infinite loop that uses the client's browser as half of the loop. Imagine just how pleased they'll be when their browser starts flickering and not responding to their efforts to stop it. I know you said the error never happens more than once. Even if this is true, some other fault in the system might cause 100% failures in this section of code. If you truly believe the error only happens once and can never be fixed, then just: <dtml-try> <dtml-var "error_prone_method.view()"> <dtml-except KeyError> <dtml-var "error_prone_method.view()"> </dtml-try> At least this way you aren't dragging your visitor down with you.
From: "Ken" <firerooster@netscape.net>
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.
I've seen those kind of problems at least in one other product that performs remote HTTP calls, and it's probable that there's an issue related to what happens to the existing persistent data when a remote call retrieves an error. If you can confirm that that is a recurrent behaviour on a fresh Zope installation, you might report a bug to Kedai (KebasData's author). Ausum
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
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
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.
will the same key error (value) happen, or is the key error (value) random? could you get the html source/or get the stuff from error_log also, will this happen on a fres zope? or with higher refresh / cache time? -- http://www.kedai.com.my/ http://www.kedai.com.my/eZine http://www.zope.org/Members/kedai http://www.my-zope.org We don't need no, no no no, no parental guidance here
participants (4)
-
Ausum Studio -
Bakhtiar A Hamid -
Charlie Reiman -
Ken