def get_likes(): try: return jsonify(database.get_likes()) except ValueError as e: return make_response(str(e), 400) except Exception as e: return make_response(str(e), 500)
def get_likes(): try: drinker = request.args.get("drinker") if drinker is None: raise ValueError("Drinker is not specified.") return jsonify(database.get_likes(drinker)) except Exception as e: return make_response(str(e), 500)