[Zope-PAS] [Checkins] SVN: Products.PluggableAuthService/trunk/Products/PluggableAuthService/PluggableAuthService.py don't swallow exceptions for plugins that don't want to
Wichert Akkerman
wichert at wiggy.net
Tue Oct 12 08:19:51 EDT 2010
On 2010-10-12 10:54, Florian Friesdorf wrote:
> In my opinion plugins should not abuse standard python exceptions to
> indicate that a user was not found but use a dedicated PAS exception for
> that. Or, at least, there should be exactly one standard python
> exception to indicate that.
Those exceptions are not part of the API, and are not abused (barring bugs).
> Currently, by default, NameError, AttributeError, KeyError, TypeError
> and ValueError are swallowed.
For good reason: if exceptions are not swallowed a single broken PAS
plugin will take down your entire Zope, with leaving modifying of code
or lots of painful work in a debug prompt to reconfigure PAS as the only
way out.
> After enabling the reraise of these exceptions, they got caught and
> ended up in the log. I assume this is safe. If there are doubts, we
> could rename the flag to: _dont_swallow_my_exceptions_in_debug_mode.
That would certainly be more intuitive.
> However, in order to spare PAS newbies time and frustration, this should
> be the default in debug mode. I don't know how many PAS plugins rely on
> this swallowing of exceptions.
Several in my experience.
Wichert.
--
Wichert Akkerman <wichert at wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
More information about the Zope-PAS
mailing list