From 47c85147a5341717db88c2bbcd02ddccaa8898f9 Mon Sep 17 00:00:00 2001 From: Kiall Mac Innes Date: Tue, 11 Dec 2012 06:23:45 -0800 Subject: [PATCH] Ensure Warlock passes the approperiate error message along with it's exceptions. Change-Id: I966555181ab63ae50cadfd61ac38abda51f46350 --- monikerclient/warlock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monikerclient/warlock.py b/monikerclient/warlock.py index ad2bfad..c0337a0 100644 --- a/monikerclient/warlock.py +++ b/monikerclient/warlock.py @@ -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):