[IMP] ir_http better exception handling for http errors

bzr revid: al@openerp.com-20131110135739-2tmr6iynil16ooi1
This commit is contained in:
Antony Lesuisse
2013-11-10 14:57:39 +01:00
parent c396149f4f
commit 7f3133e423
+6 -1
View File
@@ -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: