QE-0047-A·————-——-——T——:——:——
Sign out
| description | Audit error messages across the codebase using Wix's Errorgate framework. Finds generic, unclear, and user-hostile error messages and proposes rewrites with full triggering context. |
|---|---|
| allowed-tools | Bash(rg:*), Bash(grep:*), Bash(find:*), Bash(wc:*), Bash(git:*), Read, Glob, Grep |
You are auditing error messages in this codebase using the framework from Wix's Errorgate 2021 effort. The goal: find every bad error message, map why it's triggered, and propose a rewrite that tells users what happened, why, and how to fix it.
This is not a content-only pass. Most generic errors are symptoms of missing product/dev work — your audit must surface that too.
Find every error message in the codebase. Cast a wide net:
# String literals near error keywords
rg -n --no-heading -i "(throw new Error|toast\.error|console\.error|notify\.error|setError|errorMessage|message:)" --type-add 'web:*.{ts,tsx,js,jsx,vue,svelte}' -t web -t py
# i18n / locale keys
rg -n --no-heading -i "error" --glob "**/*.{json,yaml,yml}" --glob "**/locales/**" --glob "**/i18n/**" --glob "**/translations/**"
# Status/toast/alert components
rg -n --no-heading "(<Alert|<Toast|<ErrorBoundary|<Banner)" --type-add 'web:*.{tsx,jsx,vue}' -t web
Adapt the patterns to whatever stack this repo actually uses. Check package.json / pyproject.toml / go.mod first to see what you're dealing with, then choose patterns accordingly.
Report the total count up front. Wix had 7,643 — give the user the equivalent number for this repo so they know the scope.
For each error message, place it in one of four buckets:
| Bucket | Definition | Example |
|---|---|---|
| Generic | Says nothing useful | "Something went wrong", "An error occurred", "Failed" |
| Unclear | Tries to explain but uses jargon or confusing language | "Failed to fetch", "Credentials denied", "ECONNREFUSED" |
| Blame-passing | Shames the user or third parties | "You entered invalid data", "Stripe is down" |
| Acceptable | Says what happened, why, and how to fix | "We couldn't save your draft because you're offline. Your changes are kept locally and will sync when reconnected." |
Skip the Acceptable bucket in your output — only surface what needs work.
For each problem message, do the work a Wix dev would do during error mapping. Read the surrounding code and answer:
This step is the whole point. A rewrite without this mapping is just word-polish.
For each entry, output this structure:
### `path/to/file.ts:42`
**Current:** "Something went wrong"
**Bucket:** Generic
**Triggered by:** `saveInvoice()` catch block when Supabase RPC throws
**Underlying failure:** Network timeout OR RLS policy rejection — currently indistinguishable
**Frequency guess:** High (every save attempt)
**User-actionable:** Sometimes (network: yes, RLS: no)
**Info we're discarding:** `error.code`, `error.hint`, retry count
**Proposed rewrite (network case):**
> We couldn't save your invoice because the connection dropped. Your changes are kept on this device — we'll retry automatically when you're back online.
**Proposed rewrite (permission case):**
> We couldn't save this invoice because your account doesn't have permission for this workspace. Contact your admin or [reach support](#).
**Required code changes:**
- Distinguish error types in catch block (check `error.code`)
- Surface retry state to UI
- Add Sentry breadcrumb with `error.hint` for support diagnosis
Note that some rewrites require code changes, not just string changes. Flag those clearly — the user needs to know which fixes are 5-minute jobs versus tickets.
End with a prioritized table sorted by impact (frequency × user-blocking):
| Priority | File | Current | Bucket | Effort |
|---|---|---|---|---|
| P0 | auth/login.ts:88 | "Login failed" | Generic | Code change needed |
| P0 | payment/checkout.ts:201 | "Payment error" | Generic | Content + code |
| P1 | forms/validate.ts:34 | "Invalid input" | Unclear | Content only |
P0 = hot path AND blocks user. P1 = hot path OR blocks user. P2 = everything else.
Begin with: Audited N error messages across M files. Found X generic, Y unclear, Z blame-passing.
Then the per-file breakdowns, then the priority table.
If the codebase has more than ~50 problem messages, batch by directory or feature area and ask the user which area to drill into first. Don't drown them.
Audit error messages and proposes rewrites.