[Zope3-checkins] SVN: Zope3/trunk/src/zope/component/ The
ComponentLookupError resulting from a failed adapter lookup now
Jim Fulton
jim at zope.com
Wed Dec 22 11:12:35 EST 2004
Log message for revision 28684:
The ComponentLookupError resulting from a failed adapter lookup now
includes a name.
Changed:
U Zope3/trunk/src/zope/component/README.txt
U Zope3/trunk/src/zope/component/__init__.py
-=-
Modified: Zope3/trunk/src/zope/component/README.txt
===================================================================
--- Zope3/trunk/src/zope/component/README.txt 2004-12-22 15:49:05 UTC (rev 28683)
+++ Zope3/trunk/src/zope/component/README.txt 2004-12-22 16:12:35 UTC (rev 28684)
@@ -152,7 +152,7 @@
... # doctest: +ELLIPSIS
Traceback (most recent call last):
...
- ComponentLookupError: (...Person...>, <...IGreeter>)
+ ComponentLookupError: (...Person...>, <...IGreeter>, 'frank')
Adapters can adapt multiple objects:
Modified: Zope3/trunk/src/zope/component/__init__.py
===================================================================
--- Zope3/trunk/src/zope/component/__init__.py 2004-12-22 15:49:05 UTC (rev 28683)
+++ Zope3/trunk/src/zope/component/__init__.py 2004-12-22 16:12:35 UTC (rev 28684)
@@ -134,7 +134,7 @@
def getAdapter(object, interface, name, context=None):
adapter = queryAdapter(object, interface, name, None, context)
if adapter is None:
- raise ComponentLookupError(object, interface)
+ raise ComponentLookupError(object, interface, name)
return adapter
def adapter_hook(interface, object, name='', default=None):
@@ -159,7 +159,7 @@
def getMultiAdapter(objects, interface, name=u'', context=None):
adapter = queryMultiAdapter(objects, interface, name, context=context)
if adapter is None:
- raise ComponentLookupError(objects, interface)
+ raise ComponentLookupError(objects, interface, name)
return adapter
def queryMultiAdapter(objects, interface, name=u'', default=None,
More information about the Zope3-Checkins
mailing list