chore(api): expose real 500 error stack trace for scrap scan API

This commit is contained in:
DXC
2026-03-26 16:59:14 +08:00
parent 46dd8f1c3a
commit d58b002340
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@ -50,8 +50,9 @@ def scan_barcode():
else:
return jsonify({'code': 404, 'msg': '未找到对应的库存记录'}), 404
except Exception as e:
traceback.print_exc()
return jsonify({'code': 500, 'msg': f'扫描查询出错: {str(e)}'}), 500
import traceback
traceback.print_exc() # 强制在控制台打印真实错误堆栈
return jsonify({"code": 500, "msg": f"服务器内部错误详情: {str(e)}"}), 500
# --------------------------------------------------------