Explain an Error Message
Get a grounded explanation of what's actually causing an error, instead of a generic guess dressed up as a confident answer.
Prompt template
Replace the parts in curly braces: the exact error message and stack trace, relevant code snippet, what you were trying to do
Explain what's causing this error and how to fix it. Here's the exact error and stack trace, the relevant code, and what I was trying to do. If you're not certain of the cause, say what additional information (logs, versions, config) would help narrow it down instead of guessing at a fix.
Error: {the exact error message and stack trace}
Code: {relevant code snippet}
Context: {what you were trying to do}Example
Input: A stack trace plus the function that threw it.
Output: Illustrative only. A useful result explains the actual mechanism (e.g. "this fails because X is undefined when Y hasn't resolved yet"), not just a generic "check your imports" answer. Treat a confident-sounding fix that doesn't reference specifics of your actual error as a low-confidence guess.
Quality checklist
- Test the suggested fix against the real error before considering it solved
- Be suspicious of an explanation that doesn't reference specific details from your actual stack trace
Where this tends to go wrong
- AI can produce a plausible-sounding but wrong root cause, especially for errors involving a very new library version or project-specific config
- A suggested fix that "should" work can silently mask the real underlying bug