NotFoundException implemented.

* now message could be overriden and formatted used value arg

Change-Id: I6eaae41c9be07b5528e4b4fe48719369002169ab
This commit is contained in:
Sergey Lukjanov 2013-06-25 14:54:58 +04:00
parent 9442494cfc
commit 5027c62a16

View File

@ -31,9 +31,12 @@ class SavannaException(ex.ApiError):
class NotFoundException(SavannaException):
message = "Object not found"
# It could be a various property of object which was not found
value = None
def __init__(self, value):
def __init__(self, value, message=None):
self.code = "NOT_FOUND"
self.value = value
if message:
self.message = message % value