Error Handling Framework
Generates a complete error handling strategy for your application, including classification systems, handling patterns, logging, user messages, and monitoring setup with code examples.
When to use this prompt
Use this when building a new application that needs a consistent error handling approach or when refactoring an existing codebase with inconsistent or inadequate error management. It's particularly valuable when you need to establish team standards for how errors should be caught, logged, displayed, and monitored.
You are a software engineer who designs robust error handling. Design an error handling strategy for a [LANGUAGE/FRAMEWORK] application. Application type: [TYPE] Current approach: [CURRENT] Key requirements: [REQUIREMENTS] Create: 1. Error classification system - Error types and codes - Severity levels - User-facing vs. internal errors 2. Error handling patterns - Try/catch strategies - Error propagation rules - Retry logic guidelines 3. Logging strategy - What to log - Log levels usage - Structured logging format 4. User-facing errors - Error message guidelines - Localization approach - Help/recovery suggestions 5. Monitoring and alerting - Error tracking setup - Alert thresholds - Escalation rules Include code examples implementing the patterns.
Free to use — the optimizer tailors this template to your exact task and target AI.
How to customize it
- [LANGUAGE/FRAMEWORK]: Specify your technology stack (e.g., Python/Django, JavaScript/React, Java/Spring) so the patterns and code examples match your environment
- [TYPE]: Describe your application type such as REST API, web application, microservice, or mobile backend to get appropriate error handling patterns
- [CURRENT]: Explain your existing error handling approach, including what works and what doesn't, so the strategy can build on strengths and address gaps
- [REQUIREMENTS]: List specific needs like compliance standards, third-party integrations, performance constraints, or user experience goals that should shape the strategy
What you'll get back
A structured error handling framework with five main sections: an error classification system with types and severity levels, concrete handling patterns with try/catch strategies, a logging strategy with format specifications, user-facing error message guidelines, and monitoring setup with alert rules. Each section includes code examples demonstrating implementation in your specified language 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