[Erp5-report] r15983 - /erp5/trunk/products/ERP5Type/patches/sqlvar.py

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Aug 31 15:18:33 CEST 2007


Author: vincent
Date: Fri Aug 31 15:18:32 2007
New Revision: 15983

URL: http://svn.erp5.org?rev=15983&view=rev
Log:
Iclude representation of invalid values when detected to make log messages save investigation time.

Modified:
    erp5/trunk/products/ERP5Type/patches/sqlvar.py

Modified: erp5/trunk/products/ERP5Type/patches/sqlvar.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/patches/sqlvar.py?rev=15983&r1=15982&r2=15983&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/patches/sqlvar.py (original)
+++ erp5/trunk/products/ERP5Type/patches/sqlvar.py Fri Aug 31 15:18:32 2007
@@ -46,7 +46,7 @@
             if not v and args.has_key('optional') and args['optional']:
                 return 'null'
             raise ValueError, (
-                'Invalid integer value for <em>%s</em>' % name)
+                'Invalid integer value for <em>%s</em>: %r' % (name, v))
     elif t=='float':
         try:
             if type(v) is StringType:
@@ -58,7 +58,7 @@
             if not v and args.has_key('optional') and args['optional']:
                 return 'null'
             raise ValueError, (
-                'Invalid floating-point value for <em>%s</em>' % name)
+                'Invalid floating-point value for <em>%s</em>: %r' % (name, v))
     # Patched by yo
     elif t=='datetime':
         if v is None:
@@ -90,7 +90,7 @@
                 return 'null'
             else:
                 raise ValueError, (
-                    'Invalid string value for <em>%s</em>' % name)
+                    'Invalid string value for <em>%s</em>: %r' % (name, v))
         # End of patch
 
         if not isinstance(v, (str, unicode)):




More information about the Erp5-report mailing list