From fca83b45f8f5011767e11dc8f654c98d4228cf31 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 23 Jan 2015 15:34:53 +0100 Subject: [PATCH] [IMP] on non-rpc debug, only break on non-HTTPException Completes/improves fd6dde7ca Because Werkzeug uses/provides flow-control exceptions via HTTPException (which can be used as straight responses) they are used in a few places of the web client, when triggering some redirections for instance. Breaking into the debugger for such mundane situations is surprising and inconvenient for developers trying to debug actual issues in the system, even though HTTPExceptions are by and large not error per-se, and shouldn't warrant triggering post-mortem debugging. So in the non-RPC dispatcher, don't post-mortem on HTTPException either. --- openerp/http.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/http.py b/openerp/http.py index 6ee9aefe87b..1d35c989143 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -270,7 +270,8 @@ class WebRequest(object): to abitrary responses. Anything returned (except None) will be used as response.""" self._failed = exception # prevent tx commit - if not isinstance(exception, NO_POSTMORTEM): + if not isinstance(exception, NO_POSTMORTEM) \ + and not isinstance(exception, werkzeug.exceptions.HTTPException): openerp.tools.debugger.post_mortem( openerp.tools.config, sys.exc_info()) raise