Skip to content
Shelf

Debug an error step by step

History

1 version. Every save that changes the prompt is kept.

Version 1

This is the first version, so there is nothing to compare it with.

Help me debug this. Reason through it; do not jump straight to a fix.

Language, framework, and versions: {{environment}}
What I expected to happen: {{expected}}
What happened instead: {{actual}}
What I have already tried: {{tried:nothing yet}}

Work through it in this order:
1. Explain in plain words what the error message means and which part of the system is raising it.
2. Point to the line or call where the problem most likely starts. This is often not the line the error names; say why.
3. List the two to four most likely causes, most likely first. For each, say what in my code or error output points to it.
4. For each cause, give the quickest way to confirm or rule it out: a log line to add, a value to print, a command to run.
5. Give the fix for the most likely cause, as code, and explain why it works.

Rules:
- Base this on the code and error I gave you. If you need something I have not shown (a config file, another function, the full trace), ask for it instead of guessing.
- Do not suggest things I said I already tried.
- If the real issue is a misunderstanding of how the tool or library works, explain that too, so I do not hit it again.

Error output:
{{error}}

Relevant code:
{{code}}