1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-04 21:15:22 +02:00

chore:bump dependencies and fix errors (#2601)

* bump dependencies and fix errors

* fix depreciated arg

* properly handle validation errors
This commit is contained in:
Hayden 2023-10-07 16:02:15 -05:00 committed by GitHub
parent 954a2f5113
commit db021023fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 99 additions and 126 deletions

View file

@ -1,6 +1,7 @@
from inspect import signature
from fastapi.exceptions import HTTPException, ValidationError
from fastapi.exceptions import HTTPException, RequestValidationError
from pydantic import ValidationError
def make_dependable(cls):
@ -25,7 +26,7 @@ def make_dependable(cls):
try:
signature(init_cls_and_handle_errors).bind(*args, **kwargs)
return cls(*args, **kwargs)
except ValidationError as e:
except (ValidationError, RequestValidationError) as e:
for error in e.errors():
error["loc"] = ["query"] + list(error["loc"])
raise HTTPException(422, detail=e.errors()) from None