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

Uli Fouquet uli at gnufix.de
Mon Sep 21 10:35:48 EDT 2009


Hi JW,

Jan-Wijbrand Kolman wrote:
> Jan-Wijbrand Kolman wrote:
> > A couple of thoughts:
> > 
> > * This should be part of the upgrade notes.

Right.
 
> > * 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.

In general I'd agree, especially about the
'set-handled-exceptions-in-the-ini-file' point. It would really be nice
to be able to set these stuff in an .ini file. But three things come to
my mind:

* what you call "normally" here, is only the behaviour of the publisher 
  for the last years. Changing behaviour only to protect people from 
  setting up their tests differently is not a really strong argument to 
  me, although I can really understand the trouble.

* I am undecided about having two different behaviours for grok when 
  used in a WSGI-based debugger pipeline or not. Could that confuse 
  developers in any way?

* There are ongoing thoughts about changing the general way of marking 
  the exceptions you want to "keep inside". See

    https://mail.zope.org/pipermail/zope-dev/2009-September/037831.html

  I'd support the suggestions made there but this would mean that we 
  had to change our IReRaiseException registration anyway (at least, 
  probably, when it comes to a ZTK-KGS compatibility redesign of grok). 
  So maybe we should wait until this zope.publisher change (which is 
  likely to come) arrived? 

  On the other hand: if we reintroduce the former default behaviour for 
  non-WSGI-debugger environments for 1.0 we are less likely to have 
  additional upgrade troubles afterwards, when IPublisherExceptionInfo 
  is part of the zope.publisher we use.

Overall +0.5 for the change.

Best regards,

-- 
Uli

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.zope.org/pipermail/grok-dev/attachments/20090921/cc4ac0e1/attachment.bin 


More information about the Grok-dev mailing list