mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 06:23:34 -07:00
format
This commit is contained in:
parent
e5d5c28f71
commit
e183dd1dcd
2 changed files with 9 additions and 4 deletions
|
@ -47,8 +47,10 @@ class UserLockedOut(Exception): ...
|
||||||
|
|
||||||
class MissingClaimException(Exception): ...
|
class MissingClaimException(Exception): ...
|
||||||
|
|
||||||
|
|
||||||
class IncompleteData(Exception):
|
class IncompleteData(Exception):
|
||||||
"""
|
"""
|
||||||
This exception is raised when a user sends incomplete data to the API
|
This exception is raised when a user sends incomplete data to the API
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
|
@ -86,7 +86,10 @@ class RecipeController(BaseRecipeController):
|
||||||
raise HTTPException(status_code=404, detail=ErrorResponse.respond(message="No Entry Found"))
|
raise HTTPException(status_code=404, detail=ErrorResponse.respond(message="No Entry Found"))
|
||||||
elif thrownType == exceptions.IncompleteData:
|
elif thrownType == exceptions.IncompleteData:
|
||||||
self.logger.error("Incomplete data provided to API route")
|
self.logger.error("Incomplete data provided to API route")
|
||||||
raise HTTPException(status_code=400, detail=ErrorResponse.respond(message="Some data were missing on the body of this API request"))
|
raise HTTPException(
|
||||||
|
status_code=400,
|
||||||
|
detail=ErrorResponse.respond(message="Some data were missing on the body of this API request"),
|
||||||
|
)
|
||||||
elif thrownType == sqlalchemy.exc.IntegrityError:
|
elif thrownType == sqlalchemy.exc.IntegrityError:
|
||||||
self.logger.error("SQL Integrity Error on recipe controller action")
|
self.logger.error("SQL Integrity Error on recipe controller action")
|
||||||
raise HTTPException(status_code=400, detail=ErrorResponse.respond(message="Recipe already exists"))
|
raise HTTPException(status_code=400, detail=ErrorResponse.respond(message="Recipe already exists"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue