werkzeug.exceptions.abort(werkzeug.utils.redirect(url))
def _handle_exception(self, exception=None, code=500):
+ res = super(ir_http, self)._handle_exception(exception)
if isinstance(exception, werkzeug.exceptions.HTTPException) and hasattr(exception, 'response') and exception.response:
return exception.response
if getattr(request, 'website_enabled', False) and request.website:
html = request.website._render('website.http_error', values)
return werkzeug.wrappers.Response(html, status=code, content_type='text/html;charset=utf-8')
- return super(ir_http, self)._handle_exception(exception)
+ return res
class ModelConverter(ir.ir_http.ModelConverter):
def __init__(self, url_map, model=False):
"""Called within an except block to allow converting exceptions
to abitrary responses. Anything returned (except None) will
be used as response."""
- raise
+ self._failed = exception # prevent tx commit
def _call_function(self, *args, **kwargs):
request = self
"""Called within an except block to allow converting exceptions
to abitrary responses. Anything returned (except None) will
be used as response."""
+ super(JsonRequest, self)._handle_exception(exception)
_logger.exception("Exception during JSON request handling.")
- self._failed = exception # prevent tx commit
error = {
'code': 200,
'message': "OpenERP Server Error",