Skip to content

Commit

Permalink
[FIX] tests dont log traceback on aborted request while testing
Browse files Browse the repository at this point in the history
bzr revid: al@openerp.com-20140317135239-08aefkdxiil7bpcs
  • Loading branch information
antonylesuisse committed Mar 17, 2014
1 parent cd4f831 commit 627b5b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 4 additions & 2 deletions openerp/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,15 +361,17 @@ def dispatch(self):
response['id'] = self.jsonrequest.get('id')
response["result"] = self._call_function(**self.params)
except AuthenticationError, e:
_logger.exception("Exception during JSON request handling.")
_logger.exception("JSON-RPC AuthenticationError in %s.", self.httprequest.path)
se = serialize_exception(e)
error = {
'code': 100,
'message': "OpenERP Session Invalid",
'data': se
}
except Exception, e:
_logger.exception("Exception during JSON request handling.")
# Mute test cursor error for runbot
if not (openerp.tools.config['test_enable'] and isinstance(e, psycopg2.OperationalError)):
_logger.exception("JSON-RPC Exception in %s.", self.httprequest.path)
se = serialize_exception(e)
error = {
'code': 200,
Expand Down
2 changes: 0 additions & 2 deletions openerp/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ def acquire_test_cursor(session_id):
cr = HTTP_SESSION.get(session_id)
if cr:
cr._test_lock.acquire()
if cr._closed:
werkzeug.exceptions.abort(500)
return cr

def release_test_cursor(cr):
Expand Down

0 comments on commit 627b5b6

Please sign in to comment.