[Grok-dev] using zope.testbrowser to test for Unauthorized exceptions and updated zope.publisher with IReRaise exception support

Jan-Wijbrand Kolman janwijbrand at gmail.com
Mon Sep 21 09:05:07 EDT 2009


Jan-Wijbrand Kolman wrote:
> A couple of thoughts:
> 
> * This should be part of the upgrade notes.
> 
> * The IReRaise adapter is now registered in the configure.zcml of Grok.
> 
> I wonder if it instead shouldn't be registered in the wsgi-specific 
> grokcore.startup.startup.application_factory. Maybe even only for the 
> cases where we want to debug. In all other cases then (during testing, 
> non-wsgi deployment, using the deploy.ini profile for paste serve), the 
> error raising works as expected.

Following this line of thought:

This could be implemented by having a something like a 
"debug_application_factory()" function in grokcore.startup that would 
just after setting up the application register the IReRaise adapter for 
Unauthorized.

I can even imagine actually configuring what exceptions not to reraise 
from the debug.ini file somehow, to make this more readable/findable.

Again, this would make all other deployments and testing situations 
behave "normally" and only when using the exception middleware do 
something different. I'd prefer that, now that I'm working with it.

regards,
jw



More information about the Grok-dev mailing list