From a1fa5881e271dbb172ab3b51cdd87f8123aa0d0a Mon Sep 17 00:00:00 2001 From: Julien Muchembled <jm@nexedi.com> Date: Wed, 16 Oct 2013 11:59:10 +0200 Subject: [PATCH] Better exception handling when comparing revisions in ERP5 UI --- .../erp5_core/Base_getHistoricalComparisonDifferenceList.xml | 5 +++-- product/ERP5/bootstrap/erp5_core/bt/revision | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getHistoricalComparisonDifferenceList.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getHistoricalComparisonDifferenceList.xml index 2c999e6c14..8c28d6d874 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getHistoricalComparisonDifferenceList.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_getHistoricalComparisonDifferenceList.xml @@ -52,6 +52,7 @@ <key> <string>_body</string> </key> <value> <string>from Products.PythonScripts.standard import Object\n from ZODB.POSException import ConflictError\n +from zExceptions import Unauthorized\n Base_translateString = context.Base_translateString\n \n serial = context.REQUEST[\'serial\']\n @@ -59,9 +60,9 @@ next_serial = context.REQUEST[\'next_serial\']\n \n try:\n context.HistoricalRevisions[serial]\n -except ConflictError:\n +except (ConflictError, Unauthorized):\n raise\n -except: # POSKeyError\n +except Exception: # POSKeyError\n return [Object(property_name=Base_translateString(\'Historical revisions are\'\n \' not available, maybe the database has been packed\'))]\n \n diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 9a46fc0fd5..6739535208 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -41128 \ No newline at end of file +41129 \ No newline at end of file -- 2.30.9