Example #1
0
def get_menu(name):
    try:
        if name is None:
            raise ValueError('Bar is not specified.')
        bar = database.find_bar(name)
        if bar is None:
            return make_response("No bar found with the given name.", 404)
        return jsonify(database.get_bar_menu(name))
    except ValueError as e:
        return make_response(str(e), 400)
    except Exception as e:
        return make_response(str(e), 500)
Example #2
0
def get_menu_all():
    try:
        return jsonify(database.get_bar_menu(None))
    except Exception as e:
        return make_response(str(e), 500)