首页/ AI 技能 / @skilllib/skill-2117939930272412076
Skill站外收录 @skilllib/skill-2117939930272412076

wheels-debugging

诊断并解决 Wheels 框架中的常见错误,提供针对异常行为的分析与调试策略。涵盖参数传递、数据类型转换、关联定义、数据库表及字段匹配等问题的处理方法,同时支持通过调试输出、变量检查和 SQL 日志追踪来定位故障,适用于应用程序运行中的问题排查与修复。

0.0 (0) 21 次安装 原作者 编程导航
收录于 2026-01-22

Skills.MD

# Wheels Debugging ## Common Errors ### "Missing argument name" Error **Cause:** Mixed positional and named arguments **Solution:** Use consistent argument style ```cfm ❌ hasMany("comments", dependent="delete") ✅ hasMany(name="comments", dependent="delete") ``` ### "Can't cast Object type [Query] to [Array]" **Cause:** Using Array functions on queries **Solution:** Use query methods ```cfm ❌ ArrayLen(post.comments()) ✅ post.comments().recordCount ``` ### "Association not found" Error **Cause:** Association not properly defined or typo **Solution:** 1. Check model config() for association definition 2. Verify association name matches 3. Check model name spelling ### "Table not found" Error **Cause:** Migration not run or table name mismatch **Solution:** ```bash wheels dbmigrate latest ``` ### "Column not found" Error **Cause:** Property doesn't exist in database **Solution:** 1. Add column via migration 2. Check property name spelling 3. Verify case sensitivity ## Debugging Tools ### Enable Debug Output ```cfm // In config/settings.cfm set(showDebugInformation=true); set(showErrorInformation=true); ``` ### Inspect Variables ```cfm <cfdump var="#post#" label="Post Object"> <cfabort> ``` ### Check SQL Queries ```cfm // Wheels logs all SQL to debugging output // Look for red SQL queries (errors) ``` --- **Generated by:** Wheels Debugging Skill v1.0

评论 0

还没有评论,来抢沙发。