异常返回封装无效
来源:1-2 课程更新维护说明

光照
2021-08-26
libs/error.py
libs/error_code.py
@api.route(’/test’, methods=[‘POST’])
def test_user():
c = Success()
return c
返回如下:
500 Internal Server Error
Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
有些奇怪,改写的我都写了,怎么就是不返回json呢?error.py里面也重写了get_headers了,启动文件ginger.py 也编写了framework_error但是就是返回html
写回答
1回答
-
7七月
2021-08-26
这个只能自己调试下,方法课程里一步步演示的很清楚了。只看这个代码肯定是找不出问题的。
032021-09-11
相似问题