[UPD] Exception handling
This commit is contained in:
@@ -12,11 +12,7 @@ logger = logging.getLogger(__name__)
|
||||
@api_library.route("/<_id>", methods=["DELETE"])
|
||||
def delete_library(_id):
|
||||
|
||||
try: # TODO: function
|
||||
controller = LibraryController(_id)
|
||||
except NoResultFound as e:
|
||||
logger.debug({e})
|
||||
return { "status": "error", "error": "Library not found" }, 404
|
||||
controller = LibraryController(_id)
|
||||
|
||||
controller.delete()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user