web/application.py
branchstable
changeset 7815 2a164a9cf81c
parent 7589 d3459fe041f0
child 7855 54283a5b7afc
equal deleted inserted replaced
7814:1ec9fe1dfba9 7815:2a164a9cf81c
   421                 result = 'oops'
   421                 result = 'oops'
   422         finally:
   422         finally:
   423             if req.cnx and not commited:
   423             if req.cnx and not commited:
   424                 try:
   424                 try:
   425                     req.cnx.rollback()
   425                     req.cnx.rollback()
   426                 except:
   426                 except Exception:
   427                     pass # ignore rollback error at this point
   427                     pass # ignore rollback error at this point
   428         self.info('query %s executed in %s sec', req.relative_path(), clock() - tstart)
   428         self.info('query %s executed in %s sec', req.relative_path(), clock() - tstart)
   429         return result
   429         return result
   430 
   430 
   431     def validation_error_handler(self, req, ex):
   431     def validation_error_handler(self, req, ex):
   458                 req.data['excinfo'] = excinfo
   458                 req.data['excinfo'] = excinfo
   459             req.form['vid'] = 'error'
   459             req.form['vid'] = 'error'
   460             errview = self.vreg['views'].select('error', req)
   460             errview = self.vreg['views'].select('error', req)
   461             template = self.main_template_id(req)
   461             template = self.main_template_id(req)
   462             content = self.vreg['views'].main_template(req, template, view=errview)
   462             content = self.vreg['views'].main_template(req, template, view=errview)
   463         except:
   463         except Exception:
   464             content = self.vreg['views'].main_template(req, 'error-template')
   464             content = self.vreg['views'].main_template(req, 'error-template')
   465         raise StatusResponse(code, content)
   465         raise StatusResponse(code, content)
   466 
   466 
   467     def need_login_content(self, req):
   467     def need_login_content(self, req):
   468         return self.vreg['views'].main_template(req, 'login')
   468         return self.vreg['views'].main_template(req, 'login')