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:
parent
954a2f5113
commit
db021023fb
4 changed files with 99 additions and 126 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue