← Back to Library|PromptsDebug an Error Message

Debug an Error Message

A template for pasting error messages into an AI and getting a useful diagnosis instead of a generic explanation.

5 min|Beginner
BuildQuick WinDeveloper
Prompt Template
I'm getting this error in my app:

[paste full error message and stack trace]

Here is the relevant code:

[paste the file or function]

What I expected to happen: [one sentence]
What actually happened: [one sentence]

Diagnose the root cause. Explain why this error occurs. Then give me the minimal fix. Do not refactor unrelated code.

You give the AI the error, the code, AND the context of what you expected. The final instruction ("do not refactor unrelated code") prevents the AI from rewriting your entire file when only one line needs to change.

Every time you hit an error you don't immediately understand. Build muscle memory for this pattern.