[FIX] http.py: no traceback for SessionExpiredException
Rebase and close #3618
This commit is contained in:
parent
bc24d1b010
commit
ffda023295
|
@ -516,16 +516,19 @@ class JsonRequest(WebRequest):
|
||||||
try:
|
try:
|
||||||
return super(JsonRequest, self)._handle_exception(exception)
|
return super(JsonRequest, self)._handle_exception(exception)
|
||||||
except Exception:
|
except Exception:
|
||||||
if not isinstance(exception, openerp.exceptions.Warning):
|
if not isinstance(exception, (openerp.exceptions.Warning, SessionExpiredException)):
|
||||||
_logger.exception("Exception during JSON request handling.")
|
_logger.exception("Exception during JSON request handling.")
|
||||||
error = {
|
error = {
|
||||||
'code': 200,
|
'code': 200,
|
||||||
'message': "OpenERP Server Error",
|
'message': "Odoo Server Error",
|
||||||
'data': serialize_exception(exception)
|
'data': serialize_exception(exception)
|
||||||
}
|
}
|
||||||
if isinstance(exception, AuthenticationError):
|
if isinstance(exception, AuthenticationError):
|
||||||
error['code'] = 100
|
error['code'] = 100
|
||||||
error['message'] = "OpenERP Session Invalid"
|
error['message'] = "Odoo Session Invalid"
|
||||||
|
if isinstance(exception, SessionExpiredException):
|
||||||
|
error['code'] = 100
|
||||||
|
error['message'] = "Odoo Session Expired"
|
||||||
return self._json_response(error=error)
|
return self._json_response(error=error)
|
||||||
|
|
||||||
def dispatch(self):
|
def dispatch(self):
|
||||||
|
|
Loading…
Reference in New Issue