return true error message when validation
[tiramisu.git] / tiramisu / value.py
index 851b340..65a23b1 100644 (file)
@@ -361,10 +361,13 @@ class Multi(list):
         super(Multi, self).extend(iterable)
 
     def _validate(self, value):
         super(Multi, self).extend(iterable)
 
     def _validate(self, value):
-        if value is not None and not self.opt._validate(value):
-            raise ValueError(_("invalid value {0} "
-                             "for option {1}").format(str(value),
-                                                      self.opt._name))
+        if value is not None:
+            try:
+                self.opt._validate(value)
+            except ValueError, err:
+                raise ValueError(_("invalid value {0} "
+                                   "for option {1}: {2}").format(str(value),
+                                                                 self.opt._name, err))
 
     def pop(self, key, force=False):
         """the list value can be updated (poped)
 
     def pop(self, key, force=False):
         """the list value can be updated (poped)