From 96d9871b48802dfb6e042db7999dd74f9549c53d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 22 Sep 2005 09:22:34 +0000
Subject: [PATCH] display the cell name when an exception is raised evaluating
 it

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3824 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/PDFForm.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/product/ERP5Form/PDFForm.py b/product/ERP5Form/PDFForm.py
index fe8a61fe62..a1c69880f2 100755
--- a/product/ERP5Form/PDFForm.py
+++ b/product/ERP5Form/PDFForm.py
@@ -479,10 +479,12 @@ class PDFForm(File):
       return None
     context = {'here' : self.aq_parent, 'request' : REQUEST}
     context.update (kwargs)
-
-    compiled_tales = getEngine().compile(self.cells[cell_name])
-    value = getEngine().getContext(context).evaluate(compiled_tales)
-    return value
+    try :
+      compiled_tales = getEngine().compile(self.cells[cell_name])
+      value = getEngine().getContext(context).evaluate(compiled_tales)
+      return value
+    except Exception, e :
+      raise e.__class__, "Exception in %s :\n %s"%(cell_name, e)
 
   security.declareProtected('Change Images and Files', 'setAllCellTALES')
   def setAllCellTALES(self, new_cells) :
-- 
2.30.9