diff options
Diffstat (limited to 'odoo/http.py')
| -rw-r--r-- | odoo/http.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/odoo/http.py b/odoo/http.py index 1484b78b791..222a2eeabb4 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -5,6 +5,7 @@ import ast import collections import contextlib +import copy import datetime import functools import hashlib @@ -305,8 +306,15 @@ class WebRequest(object): and not isinstance(exception, werkzeug.exceptions.HTTPException): odoo.tools.debugger.post_mortem( odoo.tools.config, sys.exc_info()) - # otherwise "no active exception to reraise" - raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) + + # WARNING: do not inline or it breaks: raise...from evaluates strictly + # LTR so would first remove traceback then copy lack of traceback + new_cause = Exception().with_traceback(exception.__traceback__) + # tries to provide good chained tracebacks, just re-raising exception + # generates a weird message as stacks just get concatenated, exceptions + # not guaranteed to copy.copy cleanly & we want `exception` as leaf (for + # callers to check & look at) + raise exception.with_traceback(None) from new_cause def _call_function(self, *args, **kwargs): request = self |
