From 078dbf0e11e26c569748c9c261968fb237004eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 18 Jun 2026 16:26:59 +0200 Subject: [PATCH] Let the WSGI dispatcher handling exception raised within with_pool decorator --- trytond/trytond/protocols/wrappers.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/trytond/trytond/protocols/wrappers.py b/trytond/trytond/protocols/wrappers.py index 6937c078df..b115a66f46 100644 --- a/trytond/trytond/protocols/wrappers.py +++ b/trytond/trytond/protocols/wrappers.py @@ -304,21 +304,7 @@ def with_pool(func): with Transaction().start(database_name, 0, readonly=True): pool.init() - try: - result = func(request, pool, *args, **kwargs) - except (UserError, UserWarning) as e: - if request.rpc_method: - raise - else: - abort(HTTPStatus.BAD_REQUEST, e) - except exceptions.HTTPException: - raise - except Exception as e: - if request.rpc_method: - raise - else: - abort(HTTPStatus.INTERNAL_SERVER_ERROR, e) - return result + return func(request, pool, *args, **kwargs) return wrapper