mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-14 06:15:26 -05: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user