mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
fixup
Signed-off-by: Litchi Pi <litchi.pi@proton.me>
This commit is contained in:
parent
91315645d3
commit
5cd7c23174
3 changed files with 5 additions and 5 deletions
|
@ -53,4 +53,6 @@ class IncompleteData(Exception):
|
|||
This exception is raised when a user sends incomplete data to the API
|
||||
"""
|
||||
|
||||
pass
|
||||
def __init__(self, missing, *args, **kwargs):
|
||||
Exception.__init__(self, *args, **kwargs)
|
||||
self.missing = missing
|
||||
|
|
|
@ -85,9 +85,7 @@ class RecipeController(BaseRecipeController):
|
|||
self.logger.error("No Entry Found on recipe controller action")
|
||||
raise HTTPException(status_code=404, detail=ErrorResponse.respond(message="No Entry Found"))
|
||||
elif thrownType == exceptions.IncompleteData:
|
||||
print(ex.args)
|
||||
print(ex.__context__)
|
||||
missing = ex.__context__.missing
|
||||
missing = ex.missing
|
||||
self.logger.error("Incomplete data provided to API route:", missing)
|
||||
raise HTTPException(
|
||||
status_code=400,
|
||||
|
|
|
@ -393,7 +393,7 @@ class RecipeService(RecipeServiceBase):
|
|||
continue
|
||||
|
||||
if getattr(new_data, field) is None:
|
||||
raise exceptions.IncompleteData("Incomplete recipe", missing=field)
|
||||
raise exceptions.IncompleteData(missing, "Incomplete recipe")
|
||||
|
||||
if recipe is None or recipe.settings is None:
|
||||
raise exceptions.NoEntryFound("Recipe not found.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue