Error Handling Strategy Prompt Template
Design a comprehensive error handling strategy with custom error classes, logging approach, and user-facing messages.
The Prompt
Make it specific to you
PromptITIN asks a few questions and builds a version tailored to your use case.
How to use this template
Copy the template
Click the copy button to grab the full prompt text.
Fill in the placeholders
Replace anything in [BRACKETS] with your specific details.
Paste into any AI tool
Works with ChatGPT, Claude, Gemini, Cursor, and more.
Or enhance with AI
Sign in to PromptITIN and let AI tailor the prompt to your exact situation in seconds.
Why this prompt works
The three-audience framing (user / developer / monitoring system) forces the AI to design error handling that serves all three, rather than the common mistake of writing errors as if the only reader is the developer who wrote the code. The 3am quality bar is concrete and eliminates theoretical over-engineering.
Tips for best results
- Define your error handling strategy before writing application code — retrofitting it into an existing codebase is painful and often done incompletely
- The 'what NOT to log' section is the most legally important for GDPR and CCPA compliance — review it with your data protection officer if you handle EU or California user data
- Centralise error handling in one module and import it everywhere — distributed error handling strategies drift and become inconsistent over time
- Add error boundary components (React) or middleware (Express) as your first application code after defining the strategy — it ensures every route and component is covered from day one