From ea4bf9d0f9e1e685e63ebaa22eabbc2e666c4432 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 31 Aug 2007 13:18:32 +0000
Subject: [PATCH] Iclude representation of invalid values when detected to make
 log messages save investigation time.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15983 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/patches/sqlvar.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/product/ERP5Type/patches/sqlvar.py b/product/ERP5Type/patches/sqlvar.py
index d22e43bcc1..1a21f8dcc2 100644
--- a/product/ERP5Type/patches/sqlvar.py
+++ b/product/ERP5Type/patches/sqlvar.py
@@ -46,7 +46,7 @@ def SQLVar_render(self, md):
             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 @@ def SQLVar_render(self, md):
             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 @@ def SQLVar_render(self, md):
                 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)):
-- 
2.30.9