Find the Root Cause of an Error From Its Stack Trace

Turn a stack trace and the surrounding code into a root-cause diagnosis and a proper fix — not just a patch that silences the error.

0 likes 0 dislikes
Sign in to rate this prompt

Prompt

    I'm hitting an error. Help me find the root cause and fix it properly.

Error message / stack trace:
{{error}}

Relevant code:
{{code}}

What I was doing when it happened, and what I expected instead:
{{context}}

Please:
1. Explain the most likely root cause in plain language, and point to the specific line or call that triggers it.
2. Give the corrected code, changing as little as possible.
3. Explain why the fix works, and call out anything I should verify to confirm it's actually resolved.

If more than one cause is plausible, list them in order of likelihood and tell me what evidence would distinguish them. If you need information that isn't here (a value, a version, another file), ask for it rather than assuming.

Like this prompt?

Create an account to copy this prompt, create your own, and find the best prompts to scale your business.