[Zope-CMF] Q. about isConstructionAllowed
Tres Seaver
tseaver@palladion.com
Thu, 4 Oct 2001 21:42:07 -0400 (EDT)
On Thu, 4 Oct 2001, seb bacon wrote:
> * seb bacon <seb@jamkit.com> [011004 13:48]:
> > In the light of the kind of problems which occur when creating new
> > content types (see below), I was wondering why exceptions get trapped
> > by default in TypesTool._getFactoryMethod? This mostly servers to
> > obscure bugs, which is Bad.
>
> OK, further investigation shows that ZopeSecurityPolicy sometimes
> raises Unauthorized exceptions, so I'll rephrase my question: is there
> any reason why _getFactoryMethod shouldn't read
>
> except Unauthorized:
>
> rather than
>
> except:
Right now, the Types Tool assumes that *any* error in finding
or validating the factory method should make the FTI "non-addable".
If we can decide what behavior the normal CMF user should see for a
FTI which has a malformed factory or product name, and then
implementing it should be easy. If you don't swallow unexpected
exceptions here, then your users will be unable to add *any* content
if a single FTI is "broken".
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com