From 7d3e2cb3bd33a1c72e5afd029f8e0a7ea21c7dca Mon Sep 17 00:00:00 2001 From: atomi <1456417373@qq.com> Date: Tue, 10 Oct 2023 21:44:23 +0800 Subject: [PATCH] perf: HTTPException is not handled when executing SQL errors --- fastapi_amis_admin/crud/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fastapi_amis_admin/crud/base.py b/fastapi_amis_admin/crud/base.py index b27b9ee..7d8ff1b 100644 --- a/fastapi_amis_admin/crud/base.py +++ b/fastapi_amis_admin/crud/base.py @@ -216,6 +216,8 @@ def error_execute_sql(self, request: Request, error: Exception): status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, detail="Key already exists", ) from error + elif isinstance(error, HTTPException): + raise error raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"Error Execute SQL:{error}",