Commit 3aec3ce4 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Log a traceback when get_value raises an exception.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@1349 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c9f2bf0
...@@ -41,6 +41,7 @@ from AccessControl import Unauthorized, getSecurityManager, ClassSecurityInfo ...@@ -41,6 +41,7 @@ from AccessControl import Unauthorized, getSecurityManager, ClassSecurityInfo
from Products.ERP5Type.Utils import UpperCase from Products.ERP5Type.Utils import UpperCase
import psyco import psyco
import sys
# Patch the fiels methods to provide improved namespace handling # Patch the fiels methods to provide improved namespace handling
...@@ -90,7 +91,7 @@ class ERP5Field(Field): ...@@ -90,7 +91,7 @@ class ERP5Field(Field):
except: except:
# We add this safety exception to make sure we always get # We add this safety exception to make sure we always get
# something reasonable rather than generate plenty of errors # something reasonable rather than generate plenty of errors
LOG('ERP5Form.get_value, exception on tales_expr: ',0,'') LOG('ERP5Form.get_value, exception on tales_expr: ',0,'', error=sys.exc_info())
value = self.get_orig_value(id) value = self.get_orig_value(id)
else: else:
# FIXME: backwards compat hack to make sure overrides dict exists # FIXME: backwards compat hack to make sure overrides dict exists
...@@ -382,9 +383,11 @@ class ERP5Form(ZMIForm, ZopePageTemplate): ...@@ -382,9 +383,11 @@ class ERP5Form(ZMIForm, ZopePageTemplate):
if alternate_name: if alternate_name:
result[alternate_name] = value result[alternate_name] = value
except FormValidationError, e: # XXX JPS Patch for listbox except FormValidationError, e: # XXX JPS Patch for listbox
#LOG('validate_all', 0, 'FormValidationError: field = %s, errors=%s' % (repr(field), repr(errors)))
errors.extend(e.errors) errors.extend(e.errors)
result.update(e.result) result.update(e.result)
except ValidationError, err: except ValidationError, err:
#LOG('validate_all', 0, 'ValidationError: field.id = %s, err=%s' % (repr(field.id), repr(err)))
errors.append(err) errors.append(err)
if len(errors) > 0: if len(errors) > 0:
raise FormValidationError(errors, result) raise FormValidationError(errors, result)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment