Verifies error handling including empty catch detection, user-friendly messages, and logging. WARNING gate triggered during /own:done flow.
"Happy path code is easy. Error handling is where senior engineers shine."
This gate ensures the code handles failures gracefully, provides meaningful feedback to users, and doesn't silently swallow errors.
"What happens if [main operation] fails? Walk me through the user experience."
Looking for:
Example scenarios:
"What does the user see when an error occurs? Would they understand what to do next?"
Looking for:
"How would you debug this in production if something went wrong?"
Looking for:
✅ ERROR HANDLING GATE: PASSED
Error handling looks solid:
- Async operations properly wrapped
- User-friendly error messages
- Errors logged for debugging
Moving to the next gate...
⚠️ ERROR HANDLING GATE: WARNING
Found [X] error handling concerns:
**Issue 1: [Empty catch block / Missing error handling]**
Location: `file.ts:42`
Question: "What happens when this fails silently?"
**Issue 2: [Technical error shown to user]**
Location: `file.ts:88`
Question: "Will users understand 'TypeError: Cannot read property...'?"
**Issue 3: [No loading state cleanup]**
Location: `file.ts:100`
Question: "What happens to the loading spinner if this fails?"
These should be addressed to ensure a good user experience.
❌ try {
await submitForm();
} catch (error) {
// Silent failure - user has no idea
}
✅ try {
await submitForm();
} catch (error) {
console.error('Form submission failed:', error);
setError('Could not submit. Please try again.');
}
❌ try {
setLoading(true);
await fetchData();
setLoading(false);
} catch (error) {
handleError(error);
// Loading stays true forever!
}
✅ try {
setLoading(true);
await fetchData();
} catch (error) {
handleError(error);
} finally {
setLoading(false);
}
❌ catch (error) {
setError(error.message);
// User sees: "TypeError: Cannot read property 'map' of undefined"
}
✅ catch (error) {
console.error('Load failed:', error);
setError('Something went wrong. Please try again.');
}
❌ catch (error) {
setError('Error');
}
✅ catch (error) {
if (error.status === 401) {
setError('Please log in to continue.');
redirectToLogin();
} else if (error.status === 404) {
setError('Item not found.');
} else if (error.name === 'NetworkError') {
setError('Check your internet connection.');
} else {
setError('Something went wrong. Please try again.');
}
}
Instead of pointing out the fix, ask:
| Bad Message | Better Message |
|---|---|
| "Error" | "Could not save. Please try again." |
| "An error occurred" | "Unable to load your profile. Check your connection." |
| "TypeError: undefined" | "Something went wrong. Please refresh and try again." |
| "500 Internal Server Error" | "Our servers are having trouble. Please try again in a moment." |
| "Failed" | "Could not complete your request. Need help? Contact support." |
| Issue | Severity | Impact |
|---|---|---|
| Empty catch block | HIGH | Silent failures, hard to debug |
| No loading state cleanup | MEDIUM | Stuck UI, poor UX |
| Technical error shown | MEDIUM | Confusing UX, potential info leak |
| No retry option | LOW | Minor UX friction |
| Generic error message | LOW | Less helpful but not broken |