The exception message tells you where it hurt — not why. This setup runs the runtime error strategy on a production-adjacent NullReferenceException: locate the exact failure point and the state at that moment, trace the execution path backward from the throw to the trigger, and distinguish the proximate cause (what threw) from the root trigger (what made it throw) — with the runtime checklist covering null paths, dependency failures, invalid state, configuration differences, environment drift, and unchecked input contracts.
How to use this resource
1
Paste the exception raw
Message, stack, and the log lines around it — the detector recognizes them and the contract carries them verbatim.
2
Demand the trigger, not the site
Line 142 threw; the investigation asks what reached line 142 in that state.
3
Validate before patching
A null check at the throw site is a symptom fix — the contract labels it as a temporary mitigation unless the trigger is addressed.
Why This Works
Throw-site vs cause-site framing redirects effort to where the bug actually is
The runtime checklist covers the unglamorous causes (config, drift) that stack traces hide
Symptom-fix labeling stops null checks from masquerading as repairs
Best for
Exceptions that "can't happen" but did
Errors that appear in one environment and not another
Developers handed a stack trace and a deadline
Not for
Errors with no exception — wrong results are the functional-bug strategy
AI output format errors — that's the AI Output Validator
Use cases
Working a NullReferenceException back to its real cause
Separating what threw from what made it throw
Checking environment drift before blaming the code
FAQ
What do I paste into the error analysis prompt?
Paste the exception raw — the message, the full stack trace, and the log lines around it — plus what you already know: the symptoms, the reproduction steps, and the environment it happened in. The prompt carries the stack trace verbatim and flags that a staging-versus-production difference is itself a suspect, so include the environment even when it seems irrelevant.
What does the error analysis prompt produce?
It runs a ten-stage investigation ending in the most likely root cause plus at least two alternatives, each with the evidence for and against it and a step that would confirm or eliminate it. Every statement is labeled FACT, ASSUMPTION, or HYPOTHESIS, and any fix that only patches the throw site is labeled a temporary mitigation rather than a real repair.
Does the error analysis prompt fix the bug for me?
No — it diagnoses and proposes a fix with a way to verify it, but you implement and validate it in your own environment. It separates the proximate cause (what threw) from the root trigger (what made it throw), so the point is a validated diagnosis, not an unexplained patch. The gold standard it aims for is a reproduction that toggles the failure on and off.
"Fix this error" gets guesses. The investigation contract gets a ten-stage diagnosis: facts separated from assumptions, alternatives weighed, fixes justified.
"Refactor this code" invites silent behavior changes. The refactoring contract preserves business rules, outputs, and side effects — and flags uncertainty instead of deciding it.
Ask AI to analyze something and it hands back one smooth paragraph where you can't tell what you told it from what it assumed from what it's recommending. Here's how to make it split the answer into visible layers — facts, assumptions, inferences, recommendations, and what still needs checking.
A stack trace is precise about where execution stopped and nearly silent about why it started going wrong. Here is how to analyze a stack trace with AI: read the exception chain inside out, find the frames you own, and separate what the trace proves from what it merely suggests.
Software Development with AI
Tip: Save time by exploring related resources and tools that integrate with this resource.
Feedback
Send feedback to NewPrompt
Found a bug, have a suggestion, or want to report something confusing? Send a short note.
Cookie preferences
NewPrompt uses optional Google Analytics cookies to understand site usage and improve the tools.
The site works normally if you decline analytics cookies.
Read more in our Cookie Policy.