[IMP] ir_http better exception handling for http errors
bzr revid: al@openerp.com-20131110135739-2tmr6iynil16ooi1
This commit is contained in:
@@ -131,8 +131,13 @@ class ir_http(osv.AbstractModel):
|
||||
try:
|
||||
request.set_handler(func, arguments, auth_method)
|
||||
result = request.dispatch()
|
||||
except werkzeug.exceptions.HTTPException, e:
|
||||
fn = getattr(self, '_handle_%s' % (e.code,), None)
|
||||
if fn:
|
||||
return fn(e)
|
||||
return self._handle_500(e)
|
||||
except Exception, e:
|
||||
return self._handle_500(e)
|
||||
return self._handle_500(e)
|
||||
return result
|
||||
|
||||
# vim:et:
|
||||
|
||||
Reference in New Issue
Block a user