From ba3a24dc86908107e43f767071f5e9d01f7ea46e Mon Sep 17 00:00:00 2001 From: Arash Date: Tue, 9 Jul 2024 10:41:13 +0200 Subject: [PATCH] update with "4XX" and "5XX" --- lib/galaxy/webapps/base/api.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/galaxy/webapps/base/api.py b/lib/galaxy/webapps/base/api.py index ad0ac2d8a781..38eb01d382ce 100644 --- a/lib/galaxy/webapps/base/api.py +++ b/lib/galaxy/webapps/base/api.py @@ -239,19 +239,15 @@ def add_request_id_middleware(app: FastAPI): def include_all_package_routers(app: FastAPI, package_name: str): responses: typing.Dict[typing.Union[int, str], typing.Dict[str, typing.Any]] = { - 422: { - "description": "Validation error", + "4XX": { + "description": "Client Error", "model": MessageExceptionModel, }, - } - for code, error in error_codes_by_int_code.items(): - code_int = int(str(code)[:3]) - if code_int in [0, 204] or code_int in responses: - continue - responses[code_int] = { - "description": str(error), + "5XX": { + "description": "Server Error", "model": MessageExceptionModel, - } + }, + } for _, module in walk_controller_modules(package_name): router = getattr(module, "router", None) if router: