chore(api): expose real 500 error stack trace for scrap scan API
This commit is contained in:
BIN
deploy.tar.gz
BIN
deploy.tar.gz
Binary file not shown.
@ -50,8 +50,9 @@ def scan_barcode():
|
|||||||
else:
|
else:
|
||||||
return jsonify({'code': 404, 'msg': '未找到对应的库存记录'}), 404
|
return jsonify({'code': 404, 'msg': '未找到对应的库存记录'}), 404
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
traceback.print_exc()
|
import traceback
|
||||||
return jsonify({'code': 500, 'msg': f'扫描查询出错: {str(e)}'}), 500
|
traceback.print_exc() # 强制在控制台打印真实错误堆栈
|
||||||
|
return jsonify({"code": 500, "msg": f"服务器内部错误详情: {str(e)}"}), 500
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user