]> hydra-www.ietfng.org Git - dyna2/commitdiff
better error msgs.
authorTim Vieira <tim.f.vieira@gmail.com>
Thu, 18 Jul 2013 17:01:19 +0000 (13:01 -0400)
committerTim Vieira <tim.f.vieira@gmail.com>
Thu, 18 Jul 2013 17:01:19 +0000 (13:01 -0400)
src/Dyna/Backend/Python/stdlib.py

index c6cdd30bbca98a1f1f911fe03a49cf7568dc0a14..b448afb648c8c86a533917a4c8ef236c2dda48cc 100644 (file)
@@ -8,17 +8,20 @@ from glob import glob
 
 def or_(x, y):
     if not (isbool(x) and isbool(y)):
-        raise TypeError('')
+        raise TypeError('`|` expected Boolean arguments, got `%s` and `%s`' \
+                            % (type(x).__name__, type(y).__name__))
     return todyna(x or y)
 
 def and_(x, y):
     if not (isbool(x) and isbool(y)):
-        raise TypeError('')
+        raise TypeError('`&` expected Boolean arguments, got `%s` and `%s`' \
+                            % (type(x).__name__, type(y).__name__))
     return todyna(x and y)
 
 def not_(x):
     if not isbool(x):
-        raise TypeError(repr(x))
+        raise TypeError('`!` expected Boolean arguments, got `%s`' \
+                            % type(x).__name__)
     if x:
         return false
     else: