Commit a1fa5881 authored by Julien Muchembled's avatar Julien Muchembled

Better exception handling when comparing revisions in ERP5 UI

parent da28fae5
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.PythonScripts.standard import Object\n <value> <string>from Products.PythonScripts.standard import Object\n
from ZODB.POSException import ConflictError\n from ZODB.POSException import ConflictError\n
from zExceptions import Unauthorized\n
Base_translateString = context.Base_translateString\n Base_translateString = context.Base_translateString\n
\n \n
serial = context.REQUEST[\'serial\']\n serial = context.REQUEST[\'serial\']\n
...@@ -59,9 +60,9 @@ next_serial = context.REQUEST[\'next_serial\']\n ...@@ -59,9 +60,9 @@ next_serial = context.REQUEST[\'next_serial\']\n
\n \n
try:\n try:\n
context.HistoricalRevisions[serial]\n context.HistoricalRevisions[serial]\n
except ConflictError:\n except (ConflictError, Unauthorized):\n
raise\n raise\n
except: # POSKeyError\n except Exception: # POSKeyError\n
return [Object(property_name=Base_translateString(\'Historical revisions are\'\n return [Object(property_name=Base_translateString(\'Historical revisions are\'\n
\' not available, maybe the database has been packed\'))]\n \' not available, maybe the database has been packed\'))]\n
\n \n
......
41128 41129
\ No newline at end of file \ No newline at end of file
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