From: Ian B. <ia...@co...> - 2005-04-21 19:40:49
|
michelts wrote: > What is the correct syntax or who is wrong, the code or the doc? > Anyway I can't redirect the page to another one or can't write the > data, Is this correct? Am I doing something wrong? Do you have any > working example of handleExceptions usage? > > My goal is to catch the Forbidden exception raised by LoginKit, I want > to tell the user it is not allowed to view the content on a better > way... Hmm... the exception handling was always fuzzy. LoginKit is the only thing using it now, catching HTTPUnauthorized, I believe. I think that's working (though I don't usually raise that exception directly), and even then I put in some dumb workarounds for 0.8.1 compatibility, so I don't know what's correct and incorrect in it now. All exceptions actually go to component.Component.handleExceptionEvent, and it in turn dispatches the exception. From that it looks like the docs are wrong, and HTTPForbiddenEvent should be called. I can't see any reason that would be a problem. Hmm... *except* that it should check for "break" as from the sub-event-handler and pass that back up, like a change from line 141: result = meth(exc) if not result or result == 'break': return result -- Ian Bicking / ia...@co... / http://blog.ianbicking.org |