Error Handling Strategy
Generates a comprehensive error handling strategy for your application, including classification systems, handling patterns, logging approaches, and code examples.
When to use this prompt
Use this when architecting error handling for a new application or standardizing how an existing system catches, logs, and communicates errors. It's particularly valuable when you need to establish consistent practices across a codebase or team.
You are a software architect designing error handling systems. Design an error handling strategy for [APPLICATION TYPE]. Context: - Language/framework: [LANGUAGE] - Architecture: [MONOLITH/MICROSERVICES] - Error sources: [SOURCES] - User types: [USERS] Create: 1. Error classification - Error types and categories - Severity levels - User-facing vs internal 2. Handling patterns - Try-catch strategies - Error boundaries - Graceful degradation - Circuit breakers 3. Error objects - Standard error format - Error codes system - Internationalization 4. Logging strategy - What to log - Log levels - Structured logging format - PII handling 5. User communication - Error message guidelines - User-friendly messages - Retry guidance 6. Monitoring & alerting - Error tracking setup - Alert thresholds - Escalation paths 7. Code examples - Implementation patterns - Middleware setup - Testing approaches
Free to use — the optimizer tailors this template to your exact task and target AI.
How to customize it
- [APPLICATION TYPE] — Specify the kind of software you're building (e.g., REST API, web app, mobile backend, data pipeline)
- [LANGUAGE] — Enter your programming language and framework (e.g., Python/Django, Node.js/Express, Java/Spring Boot)
- [MONOLITH/MICROSERVICES] — Indicate your architectural pattern, which affects how errors propagate and where boundaries exist
- [SOURCES] — List where errors originate in your system (e.g., database connections, third-party APIs, user input validation, file operations)
What you'll get back
A structured error handling strategy document covering seven areas: error classification with severity levels, handling patterns like circuit breakers and error boundaries, standardized error object formats with codes, logging strategy including PII considerations, user-facing message guidelines, monitoring and alerting configuration, and concrete code examples showing implementation patterns and
More Coding prompts
Code Reviewer
Instructs AI to perform a comprehensive code review covering bugs, security, performance, style, and best practices with severity ratings and corrections.
Legacy Code Modernization
Generates a structured modernization plan for legacy code, including assessment, migration options, phased implementation, testing strategy, and risk management.
Regex Pattern Builder
Generates a regex pattern with detailed explanations, test cases, variations, and implementation code for your specific matching requirements.
Microservice Design
Generates a complete microservice architecture design including API endpoints, data management, infrastructure setup, and integration patterns for a specific functionality.
Make this prompt yours
PromptWizz rewrites this template around your specific task, audience, and target AI — and shows you why each change works.
Try the Optimizer Free