changeset 2527:4f6f7e56eb40

fix error message for get_* (arg parser)
author Johannes Berg <johannes AT sipsolutions DOT net>
date Mon, 23 Jul 2007 11:36:37 +0200
parents 860e7bf6c4cc
children 1ae621d83c5b
files MoinMoin/wikiutil.py
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/wikiutil.py	Mon Jul 23 11:35:07 2007 +0200
+++ b/MoinMoin/wikiutil.py	Mon Jul 23 11:36:37 2007 +0200
@@ -1353,9 +1353,12 @@
         return True
     else:
         if name:
-            raise ValueError(_('Argument "%s" must be a boolean value') % name)
+            raise ValueError(
+                _('Argument "%s" must be a boolean value, not "%s"') % (
+                    name, arg))
         else:
-            raise ValueError(_('Argument must be a boolean value'))
+            raise ValueError(
+                _('Argument must be a boolean value, not "%s"') % arg)
 
 
 def get_int(request, arg, name=None, default=None):
@@ -1382,9 +1385,12 @@
         return int(arg)
     except ValueError:
         if name:
-            raise ValueError(_('Argument "%s" must be an integer value') % name)
+            raise ValueError(
+                _('Argument "%s" must be an integer value, not "%s"') % (
+                    name, arg))
         else:
-            raise ValueError(_('Argument must be an integer value'))
+            raise ValueError(
+                _('Argument must be an integer value, not "%s"') % arg)
 
 
 def get_float(request, arg, name=None, default=None):
@@ -1411,9 +1417,11 @@
     except ValueError:
         if name:
             raise ValueError(
-                _('Argument "%s" must be a floating point value') % name)
+                _('Argument "%s" must be a floating point value, not "%s"') % (
+                    name, arg))
         else:
-            raise ValueError(_('Argument must be a floating point value'))
+            raise ValueError(
+                _('Argument must be a boolean value, not "%s"') % arg)
 
 
 def get_unicode(request, arg, name=None, default=None):