web/views/basecontrollers.py
changeset 3589 a5432f99f2d9
parent 3524 a3431f4e2f40
parent 3571 54743fc6172c
child 3629 559cad62c786
--- a/web/views/basecontrollers.py	Wed Sep 30 18:57:42 2009 +0200
+++ b/web/views/basecontrollers.py	Wed Oct 07 12:31:08 2009 +0200
@@ -198,6 +198,10 @@
             req.cnx.commit() # ValidationError may be raise on commit
         except ValidationError, ex:
             return (False, _validation_error(req, ex), ctrl._edited_entity)
+        except Exception, ex:
+            req.cnx.rollback()
+            req.exception('unexpected error while validating form')
+            return (False, req._(str(ex).decode('utf-8')), ctrl._edited_entity)
         else:
             return (True, ex.location, ctrl._edited_entity)
     except Exception, ex: