From e701019514534f7f94681c279f4df3111430e791 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 19 Oct 2005 15:28:24 +0000
Subject: [PATCH] log the exception when importing local document or property
 sheet  fails

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4078 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/Utils.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py
index f5f46f9100..dcdae37887 100755
--- a/product/ERP5Type/Utils.py
+++ b/product/ERP5Type/Utils.py
@@ -44,7 +44,7 @@ from Products.ERP5Type import Constraint
 from Products.ERP5Type import Interface
 from Products.ERP5Type import PropertySheet
 
-from zLOG import LOG
+from zLOG import LOG, PROBLEM
 
 #####################################################
 # Global Switches
@@ -661,11 +661,11 @@ def initializeLocalDocumentRegistry():
         module_name = file_name[0:-3]
         try:
           importLocalDocument(module_name, document_path = document_path)
-          LOG('Added local document to ERP5Type repository: %s (%s)' % (module_name, document_path),0,'')
-          #print 'Added local document to ERP5Type repository: %s (%s)' % (module_name, document_path)
-        except:
-          LOG('Failed to add local document to ERP5Type repository: %s (%s)' % (module_name, document_path),0,'')
-          #print 'Failed to add local document to ERP5Type repository: %s (%s)' % (module_name, document_path)
+          LOG('Added local document to ERP5Type repository: %s (%s)' 
+                % (module_name, document_path), 0, '')
+        except Exception, e:
+          LOG('Failed to add local document to ERP5Type repository: %s (%s)'
+                % (module_name, document_path), PROBLEM, '', e)
 
 def initializeLocalPropertySheetRegistry():
   if not getConfiguration: return
@@ -683,11 +683,11 @@ def initializeLocalPropertySheetRegistry():
         module_name = file_name[0:-3]
         try:
           importLocalPropertySheet(module_name, path = document_path)
-          LOG('Added local property sheet to ERP5Type repository: %s (%s)' % (module_name, document_path),0,'')
-          #print 'Added local property sheet to ERP5Type repository: %s (%s)' % (module_name, document_path)
-        except:
-          LOG('Failed to add local property sheet to ERP5Type repository: %s (%s)' % (module_name, document_path),0,'')
-          #print 'Failed to add local property sheet to ERP5Type repository: %s (%s)' % (module_name, document_path)
+          LOG('Added local property sheet to ERP5Type repository: %s (%s)' 
+                % (module_name, document_path), 0, '')
+        except Exception, e:
+          LOG('Failed to add local property sheet to ERP5Type repository: %s (%s)'
+                % (module_name, document_path), PROBLEM, '', e)
 
 #####################################################
 # Product initialization
-- 
2.30.9