From e1ebbfcf2de48b0cd7f6422cb772433688dc5f53 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Mon, 19 Nov 2012 10:10:09 +0100 Subject: [PATCH] Improve error message for wrong opcode parameter values When given an empty string as value to a parameter that doesn't accept empty strings, the error message was confusing, since it was showing just as a double space. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Adeodato Simo <dato@google.com> --- lib/opcodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/opcodes.py b/lib/opcodes.py index e12a994ac..d73388e40 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -469,8 +469,8 @@ 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" - " expecting type %s", + 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), -- GitLab