fix(api): expose real 500 error stack trace and fix missing func import
This commit is contained in:
@ -313,7 +313,9 @@ def delete_buy(id):
|
||||
# 捕获业务拦截的报错,返回友好的 msg
|
||||
return jsonify({"code": 400, "msg": str(ve)})
|
||||
except Exception as e:
|
||||
return jsonify({"code": 500, "msg": "服务器内部错误,请联系系统管理员"}), 500
|
||||
import traceback
|
||||
traceback.print_exc() # 在控制台打印真实错误堆栈
|
||||
return jsonify({"code": 500, "msg": f"服务器内部错误详情: {str(e)}"}), 500
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user