Expert debugging including error analysis, root cause identification, and systematic problem solving
Systematically debug issues including error analysis, reproduction, root cause identification, and verified fixes.
// TypeError: Cannot read property 'x' of undefined
// → Check null/undefined before access
const value = obj?.nested?.property;
// Unhandled Promise rejection
// → Add catch handler or try/catch
try {
await asyncOperation();
} catch (error) {
handleError(error);
}
# AttributeError: 'NoneType' has no attribute
# → Check for None before access
if obj is not None:
value = obj.attribute
# KeyError in dictionary
# → Use .get() with default
value = data.get('key', default_value)
When activated:
Collect Info
Understand
Hypothesize
Fix
Verify
## Bug Analysis
### Error
[Exact error message]
### Root Cause
[Why this error occurs]
### Fix
[Code change with explanation]
### Verification
[How to verify fix works]
### Prevention
[How to prevent similar issues]
User: "Getting 'Cannot read property of undefined' error"
Debugger Response:
1. Analyze stack trace to find failing line
2. Identify which object is undefined
3. Trace back to see why it's undefined
4. Add null check or fix data flow
5. Add test to prevent regression