Update catalogs and providers error messages
This commit is contained in:
parent
76e4837201
commit
c6b79a8052
|
@ -336,8 +336,8 @@ class DynamicCatalog(object):
|
|||
|
||||
if (self.__class__.provider_type and
|
||||
not isinstance(provider, self.__class__.provider_type)):
|
||||
raise Error('{0} can contaon only {1} instances'.format(
|
||||
self.name, self.__class__.provider_type))
|
||||
raise Error('{0} can contain only {1} instances'.format(
|
||||
self, self.__class__.provider_type))
|
||||
|
||||
if name in self.providers:
|
||||
raise Error('Catalog {0} already has provider with '
|
||||
|
|
|
@ -407,9 +407,7 @@ class Factory(Callable):
|
|||
if (self.__class__.provided_type and
|
||||
not issubclass(provides, self.__class__.provided_type)):
|
||||
raise Error('{0} can provide only {1} instances'.format(
|
||||
'.'.join((self.__class__.__module__,
|
||||
self.__class__.__name__)),
|
||||
self.__class__.provided_type))
|
||||
self.__class__, self.__class__.provided_type))
|
||||
|
||||
self.attributes = tuple(injection
|
||||
for injection in args
|
||||
|
|
|
@ -31,5 +31,5 @@ try:
|
|||
some_service_provider = ServiceProvider(object)
|
||||
except errors.Error as exception:
|
||||
print exception
|
||||
# __main__.ServiceProvider can provide only
|
||||
# <class '__main__.ServiceProvider'> can provide only
|
||||
# <class '__main__.BaseService'> instances
|
||||
|
|
|
@ -31,5 +31,5 @@ try:
|
|||
some_service_provider = ServiceProvider(object)
|
||||
except errors.Error as exception:
|
||||
print exception
|
||||
# __main__.ServiceProvider can provide only
|
||||
# <class '__main__.ServiceProvider'> can provide only
|
||||
# <class '__main__.BaseService'> instances
|
||||
|
|
Loading…
Reference in New Issue