validateexception.msg right use devel
authorSandro Knauß <knauss@netzguerilla.net>
Fri, 27 Jan 2012 21:14:18 +0100
branchdevel
changeset 116 48c70425bf6c
parent 115 323d06431100
child 117 351a02310dd8
validateexception.msg right use
iro/error.py
--- a/iro/error.py	Fri Jan 27 17:49:57 2012 +0100
+++ b/iro/error.py	Fri Jan 27 21:14:18 2012 +0100
@@ -23,7 +23,9 @@
     def __init__(self, code=700, field=None, msg=None):
         self.code=code
         self.field=field
-        self.msg='Validation failed.'
+        self.msg = msg
+        if not msg:
+            self.msg='Validation failed.'
         if field and not msg:
             self.msg="Validation of '%s' failed."%field