details: https://code.tryton.org/tryton/commit/cbcc3537901f
branch: default
user: Cédric Krier <[email protected]>
date: Thu Jun 18 16:26:59 2026 +0200
description:
Let the WSGI dispatcher handling exception raised within with_pool
decorator
diffstat:
trytond/trytond/protocols/wrappers.py | 16 +---------------
1 files changed, 1 insertions(+), 15 deletions(-)
diffs (26 lines):
diff -r ca69387922e2 -r cbcc3537901f trytond/trytond/protocols/wrappers.py
--- a/trytond/trytond/protocols/wrappers.py Thu Jun 18 16:24:23 2026 +0200
+++ b/trytond/trytond/protocols/wrappers.py Thu Jun 18 16:26:59 2026 +0200
@@ -304,21 +304,7 @@
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