Don't raise value error

This commit is contained in:
Joshua Harlow 2016-05-13 18:02:56 -07:00
parent 7376d89e71
commit 3a39ad8b1d
2 changed files with 5 additions and 1 deletions

View File

@ -82,7 +82,10 @@ class ZookeeperQuotaEngine(engine.QuotaEngine):
limit, kind='upper_bound'):
processor = self.processors.get(kind)
if not processor:
raise ValueError("Unsupported kind '%s'" % kind)
raise exceptions.UnsupportedKind(
"Unsupported kind '%s' requested"
" for resource '%s' owned by '%s'"
% (kind, resource, for_who))
who_path = paths.join(self.uri.path, for_who)
self.client.ensure_path(who_path)
resource_path = paths.join(who_path, resource)

View File

@ -21,6 +21,7 @@ from delimiter import exceptions
BoundedResource = collections.namedtuple('BoundedResource',
['consumed', 'bound'])
class UpperBoundProcessor(object):
"""Processes a limit given some upper bound."""