Engineering Error Analysis Debugging

Error Analysis Prompt

An exception is a symptom, not a diagnosis: trace from the throw site back to the root trigger, with the runtime checklist on the table.

Overview

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.

More resources from Debugging Prompt Generator

Resources that pair well

Related tools

Guides for this resource

Tip: Save time by exploring related resources and tools that integrate with this resource.