projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c396149
)
[IMP] ir_http better exception handling for http errors
author
Antony Lesuisse
<al@openerp.com>
Sun, 10 Nov 2013 13:57:39 +0000
(14:57 +0100)
committer
Antony Lesuisse
<al@openerp.com>
Sun, 10 Nov 2013 13:57:39 +0000
(14:57 +0100)
bzr revid: al@openerp.com-
20131110135739
-2tmr6iynil16ooi1
openerp/addons/base/ir/ir_http.py
patch
|
blob
|
history
diff --git
a/openerp/addons/base/ir/ir_http.py
b/openerp/addons/base/ir/ir_http.py
index
d6c76b1
..
6f77f9f
100644
(file)
--- a/
openerp/addons/base/ir/ir_http.py
+++ b/
openerp/addons/base/ir/ir_http.py
@@
-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: