[Zope-dev] Re: Developing plugins for PluggableAuthService

Tres Seaver tseaver at zope.com
Fri Aug 27 13:33:40 EDT 2004


Lennart Regebro wrote:

> Ah.
> 
> PAS basically swallow all errors without even logging them, meaning that 
> if you have an error, it basically makes your plugin "invisible". Not good.

Here is the relevant snippet:

   #   Errors which plugins may raise, and which we suppress:
   _SWALLOWABLE_PLUGIN_EXCEPTIONS = ( NameError
                                    , AttributeError
                                    , KeyError
                                    , TypeError
                                    , ValueError
                                    )

PAS treats any one of them as a sign of a broken plugin, and substitues 
an "empty" default if a value is expected.  My guess is that your plugin
had a mismatched argument list for the interface method, and hence 
raised a TypeError (probably in the extraction method, if none of the 
others were called).

One thing which might help your plugin is to have unit tests which 
verify the interfaces the plugin is supposed to implement.  You should 
be able to just mix in the appropriate classes from tests/conformance.py
(which expect you to have a '_getTargetClass' method).

> If an error happens, a LOG should be printed...

That wouldn't be a bad thing, at least when running in debug mode.

> I need to get myself new commit rights at Zope.org again. ;)

Please do.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com



More information about the Zope-Dev mailing list