mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-10 13:29:35 +00:00
Native data AI application framework based on AWEL+AGENT (#1152)
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: lcx01800250 <lcx01800250@alibaba-inc.com> Co-authored-by: licunxing <864255598@qq.com> Co-authored-by: Aralhi <xiaoping0501@gmail.com> Co-authored-by: xuyuan23 <643854343@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: hzh97 <2976151305@qq.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from fastapi import Request
|
||||
from fastapi.exceptions import RequestValidationError
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
from dbgpt.app.openapi.api_view_model import Result
|
||||
|
||||
@@ -7,5 +8,7 @@ from dbgpt.app.openapi.api_view_model import Result
|
||||
async def validation_exception_handler(request: Request, exc: RequestValidationError):
|
||||
message = ""
|
||||
for error in exc.errors():
|
||||
message += ".".join(error.get("loc")) + ":" + error.get("msg") + ";"
|
||||
return Result.failed(code="E0001", msg=message)
|
||||
loc = ".".join(list(map(str, error.get("loc"))))
|
||||
message += loc + ":" + error.get("msg") + ";"
|
||||
res = Result.failed(code="E0001", msg=message)
|
||||
return JSONResponse(status_code=400, content=res.dict())
|
||||
|
Reference in New Issue
Block a user