Do not convert exceptions in HTTPException for RPC calls

issue11483
review423381003
This commit is contained in:
Cédric Krier committed 2022-06-15 18:52:38 +02:00
1 parent 324180552a
commit 638f5505fa
1 file changed
+8 -2
+8 -2
View File
@@ -165,10 +165,16 @@ def with_pool(func):
raise
except (UserError, UserWarning) as e:
logger.debug('%s', request, exc_info=True)
abort(HTTPStatus.BAD_REQUEST, e)
if request.rpc_method:
raise
else:
abort(HTTPStatus.BAD_REQUEST, e)
except Exception as e:
logger.error('%s', request, exc_info=True)
abort(HTTPStatus.INTERNAL_SERVER_ERROR, e)
if request.rpc_method:
raise
else:
abort(HTTPStatus.INTERNAL_SERVER_ERROR, e)
return wrapper