export const errors = {
    name: "errors",
    description: "Error handling audit — unhandled promises, missing boundaries, incomplete error states",
    content: `Audit error handling completeness across the codebase.

## 1. Unhandled Promise Rejections
Scan every async function and Promise for:
- await without try/catch
- .then() without .catch()
- Promise.all/race/allSettled without error handling
- Supabase queries without checking .error
- fetch() calls without checking response.ok

For each: file:line, the async operation, what could fail

## 2. React Error Boundaries
- Check if root layout has an Error Boundary
- Check if major data-fetching sections have boundaries
- Check if error.tsx exists for each route segment (Next.js)
- Verify boundaries have useful fallback UI, not just "Something went wrong"

## 3. API Route Error Handling
For every API route and server action:
- Does it have a top-level try/catch?
- Does it return consistent error shapes?
- Does it avoid leaking stack traces to client?
- Does it log errors with context?
- Does it return appropriate HTTP status codes?

## 4. Form Error States
For every form component:
- Does it display validation errors?
- Does it handle submission errors?
- Does it disable submit button during submission?
- Does it show error messages clearly?

## 5. Data Fetching Error States
For every component that fetches data:
- Does it handle loading state?
- Does it handle error state with retry option?
- Does it handle empty state?
- Does it handle partial failures (some data loads, some fails)?

## 6. External Service Failures
For every external API call (Stripe, SendGrid, etc.):
- Is there timeout handling?
- Is there retry logic for transient failures?
- Is there graceful degradation?

## Output: ERROR-HANDLING-REPORT.md

### Risk Summary
- Unhandled async operations: X (CRITICAL if > 0)
- Missing error boundaries: X locations
- API routes without proper error handling: X
- Forms without error display: X
- Components without error states: X

### Critical Fixes Required
[List each unhandled async operation with fix]

### Recommended Improvements
[Prioritized list of error handling improvements]`
};
//# sourceMappingURL=errors.js.map