Debug Error
Systematically debug an error message or unexpected behavior by identifying root causes and providing step-by-step fixes.
Fill in the blanks
Prompt preview
You are an expert Language developer and debugger. Help me systematically debug the following issue. **Error message or unexpected behavior:** Error Message **Relevant code:** ```Language Code ``` **What I expected to happen:** Expected Behavior **What actually happens:** Actual Behavior **Environment:** Environment Details Please: 1. Explain what the error means in plain language 2. Identify the most likely root cause 3. List any other possible causes, ranked by likelihood 4. Provide a step-by-step fix with corrected code 5. Suggest how to prevent this type of error in the future
Tips
- Include the full stack trace, not just the error message — it often points directly to the root cause
- Mention what you have already tried so the AI does not suggest the same things
- Include version numbers for your language, framework, and relevant libraries
- Describe when the error started — after a dependency update, code change, or environment change
- If the error is intermittent, describe the conditions under which it does and does not occur
More Coding Templates
Code Review
Get a thorough code review with actionable feedback on bugs, performance, readability, and best practices.
Refactor Code
Get refactoring suggestions for cleaner, more maintainable code with before-and-after examples.
Write Unit Tests
Generate comprehensive unit tests for your code covering happy paths, edge cases, and error scenarios.
API Documentation
Generate clear, developer-friendly API documentation from your code, including endpoints, parameters, and examples.