Problem
The missing_error_handling pattern flags fetch calls as "missing error handling" even when they ARE inside try/catch blocks. The tool only sees the fetch( line, not the surrounding control flow.
Example - code that IS correct but flagged:
try {
const response = await fetch('/api/trucks/...', {...});
if (!response.ok) {
throw new Error(\`Failed: \${response.status}\`);
}
} catch (error_) {
logError('API error:', error_);
throw error_;
}
Some affected locations in food-truck-finder-poc:
components/owner/PendingUpdatesQueue.tsx:116
components/map/TrafficVolumeLayer.tsx:136
app/owner-dashboard/_components/events/MyApplications.tsx:101
app/organizer/_components/VerificationStatus.tsx:77
app/admin/_components/AdminDashboardClient.tsx:36
Root Cause
The pattern matcher only looks for fetch( token sequence without analyzing:
- Whether it's inside a try block
- Whether the function has error handling elsewhere
Severity
Medium - Causes significant noise in reports, undermines trust in the tool.
Suggested Fix
Either:
- Make the pattern aware of try/catch control flow
- Rename to "uncaught_fetch" for fetch calls not in any error-handling scope
Problem
The
missing_error_handlingpattern flags fetch calls as "missing error handling" even when they ARE inside try/catch blocks. The tool only sees thefetch(line, not the surrounding control flow.Example - code that IS correct but flagged:
Some affected locations in food-truck-finder-poc:
components/owner/PendingUpdatesQueue.tsx:116components/map/TrafficVolumeLayer.tsx:136app/owner-dashboard/_components/events/MyApplications.tsx:101app/organizer/_components/VerificationStatus.tsx:77app/admin/_components/AdminDashboardClient.tsx:36Root Cause
The pattern matcher only looks for
fetch(token sequence without analyzing:Severity
Medium - Causes significant noise in reports, undermines trust in the tool.
Suggested Fix
Either: