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:
Kevin Postlethwait 2025-04-21 14:50:12 -04:00 committed by GitHub
parent 602e949a46
commit 3110ad1e7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(