Ensure Warlock passes the approperiate error message along with it's exceptions.

Change-Id: I966555181ab63ae50cadfd61ac38abda51f46350
This commit is contained in:
Kiall Mac Innes 2012-12-11 06:23:45 -08:00
parent a17d9391b7
commit 47c85147a5

View File

@ -72,8 +72,8 @@ def model_factory(schema):
mutation[key] = value
try:
self.validator(mutation)
except ValidationError:
raise InvalidOperation()
except ValidationError, e:
raise InvalidOperation(str(e))
dict.__setitem__(self, key, value)
@ -103,8 +103,8 @@ def model_factory(schema):
mutation.update(other)
try:
self.validator(mutation)
except ValidationError:
raise InvalidOperation()
except ValidationError, e:
raise InvalidOperation(str(e))
dict.update(self, other)
def iteritems(self):