[UPD] Exception handling
This commit is contained in:
@@ -17,11 +17,5 @@ def read_libraries():
|
||||
|
||||
@api_library.route("/<_id>", methods=["GET"])
|
||||
def read_library(_id):
|
||||
try:
|
||||
library = LibraryController(_id)
|
||||
except NoResultFound as e:
|
||||
logger.debug(f"No result found for Library wid id {_id}")
|
||||
logger.debug(f"Error {e}")
|
||||
logger.debug(f"Error {dir(e)}")
|
||||
return { "status": "error", "result": "Library not found"}, 404
|
||||
library = LibraryController(_id)
|
||||
return { "status": "ok", "result": library.data.to_dict() }, 200
|
||||
|
||||
Reference in New Issue
Block a user