gpt4 book ai didi

flask - 从响应中删除添加的错误信息

转载 作者:行者123 更新时间:2023-12-03 17:21:50 24 4
gpt4 key购买 nike

使用 flask-restplus 我注意到如果我处理一些错误,例如:

api.abort(code=404, message='Item not found')

响应呈现:

{
"message": "Item not found. You have requested this URI [/item/1]
but did you mean /item/<item_id> ?"
}

我真的不想要那些额外的信息,但找不到删除它的方法。

有吗?

最佳答案

因此,这里有一个配置标志。 Reported here

ERROR_404_HELP=False

成功了

关于flask - 从响应中删除添加的错误信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55102302/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com