Error Handling Hardening
Both editors can scan and fix files systematically. The specific audit checklist prevents vague 'improve error handling' outputs. Cursor shows inline diffs for each fix. Windsurf's Cascade can apply all fixes in sequence.
Audit and improve error handling in {{file_or_module_path}}. Current state: {{current_error_handling}} Audit checklist: 1. **Unhandled promises**: Find any async operations missing try/catch or .catch() 2. **Silent failures**: Find catch blocks that swallow errors without logging or rethrowing 3. **Generic catches**: Replace catch(e) with specific error type handling where appropriate 4. **User-facing errors**: Ensure errors shown to users are helpful, not stack traces 5. **API boundaries**: Verify all API calls handle network errors, timeouts, and unexpected response shapes 6. **Validation gaps**: Find inputs that aren't validated before use For each issue, provide: - Location (file:line or function name) - Current code - Fixed code - Why this matters (what could go wrong in production) Then add: - A centralized error handler if the project doesn't have one - Retry logic for transient failures (network, rate limits) with exponential backoff - Error boundary components for React UI sections that could crash
Variables to customize
Why this prompt works
Both editors can scan and fix files systematically. The specific audit checklist prevents vague 'improve error handling' outputs. Cursor shows inline diffs for each fix. Windsurf's Cascade can apply all fixes in sequence.
What you get when you save this prompt
Your workspace unlocks powerful tools to iterate and improve.
AI Optimization
One-click improvement with structure analysis and pattern suggestions.
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
$ npm i -g @promptingbox/mcpUse Everywhere
Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.
Your prompts, organized
Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.