__init__.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:fluffy 作者: m4ce 项目源码 文件源码
def session_chain_update(session_name, table_name, chain_name):
    try:
        req = request.get_json()
        if req is None:
            req = {}
        fw.sessions[session_name].chains.update(
            name=chain_name, table=table_name, **req)
        return make_response(jsonify(message='Chain updated'), status.HTTP_200_OK)
    except ChainNotFound as e:
        http_code = status.HTTP_404_NOT_FOUND
    except ChainNotValid as e:
        http_code = status.HTTP_400_BAD_REQUEST
    except ChainNotUpdated as e:
        return make_response(jsonify(message='Chain not updated'), status.HTTP_204_NO_CONTENT)
    except Exception as e:
        http_code = status.HTTP_500_INTERNAL_SERVER_ERROR

    return make_response(jsonify(message='Failed to update chain', error=e.message), http_code)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号