From 68b2e98589f7d7d878e1daeeeb2c69d515de6ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com> Date: Fri, 28 Sep 2012 11:22:08 +0200 Subject: [PATCH] Make validation error message more useful MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: RenΓ© Nussbaumer <rn@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/opcodes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/opcodes.py b/lib/opcodes.py index 5d14bcdb7..b35cc782b 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -468,8 +468,9 @@ class BaseOpCode(objectutils.ValidatedSlots): if set_defaults or hasattr(self, attr_name): attr_val = getattr(self, attr_name) if not test(attr_val): - logging.error("OpCode %s, parameter %s, has invalid type %s/value %s", - self.OP_ID, attr_name, type(attr_val), attr_val) + logging.error("OpCode %s, parameter %s, has invalid type %s/value %s" + " expecting type %s", + self.OP_ID, attr_name, type(attr_val), attr_val, test) raise errors.OpPrereqError("Parameter '%s.%s' fails validation" % (self.OP_ID, attr_name), errors.ECODE_INVAL) -- GitLab