forked from phoenix-oss/llama-stack-mirror
fix: update ref to raw_errors due to new version of pydantic (#1995)
37da47ef8e (diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552)
Pydantic was updated from v1 to v2 in this commit which caused this
breaking change
# What does this PR do?
Part of #1857
This won't fix the Validation error with the example, but it will
correctly supply user with a proper error rather than a 5xx code.
Signed-off-by: Kevin <kpostlet@redhat.com>
This commit is contained in:
parent
602e949a46
commit
3110ad1e7c
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ async def global_exception_handler(request: Request, exc: Exception):
|
||||||
|
|
||||||
def translate_exception(exc: Exception) -> Union[HTTPException, RequestValidationError]:
|
def translate_exception(exc: Exception) -> Union[HTTPException, RequestValidationError]:
|
||||||
if isinstance(exc, ValidationError):
|
if isinstance(exc, ValidationError):
|
||||||
exc = RequestValidationError(exc.raw_errors)
|
exc = RequestValidationError(exc.errors())
|
||||||
|
|
||||||
if isinstance(exc, RequestValidationError):
|
if isinstance(exc, RequestValidationError):
|
||||||
return HTTPException(
|
return HTTPException(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue