api: raise ClientSideError rather than ValueError
This also enables the error message to be translatable. Change-Id: If63ba0f7bc04eb490578c7598875407e796700aa
This commit is contained in:
parent
06a7b498b5
commit
80eb536d9b
@ -716,7 +716,7 @@ class MeterController(rest.RestController):
|
||||
:param limit: Maximum number of samples to return.
|
||||
"""
|
||||
if limit and limit < 0:
|
||||
raise ValueError("Limit must be positive")
|
||||
raise ClientSideError(_("Limit must be positive"))
|
||||
kwargs = _query_to_kwargs(q, storage.SampleFilter.__init__)
|
||||
kwargs['meter'] = self._id
|
||||
f = storage.SampleFilter(**kwargs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user