Back to Coding

What Should You Include When Asking About an Error?

What Should You Include When Asking About an Error?
AI Tutorials Team 2 January 2026

Paste an error and ask what is wrong, and you receive a confident answer about the most common cause of that error in general. Whether it applies to you is a separate question, and the answer depends on what you supplied rather than on the model.

What is the minimum?

  • The complete error. Every line, unedited.
  • The code it points at. The function, not the single line.
  • What you expected. As opposed to what happened.
  • What changed. The last thing you did before it broke.
  • Versions. Language, framework and any relevant library.

Why does the complete error matter so much?

Because the part people trim is usually the part that identifies the cause. A trace shows the path through the code, and the useful line is frequently in the middle where somebody decided it was noise.

Copy it exactly rather than retyping, since line numbers and exact wording are what make it searchable and specific.

Why include what changed?

Because working code that stopped working points at something recent, and that narrows the search enormously. Without it, every possible cause is equally likely, and the answer reflects that.

This worked before I [change]. Here is the complete error, the function it points at, and the versions I am using. What are the two most likely causes given specifically what changed?

Why state what you expected?

Because half of debugging is establishing that the code is wrong rather than your expectation. Saying what you thought would happen occasionally produces an answer explaining that the code is correct and your understanding is not, which is a more useful outcome than a fix.

What about versions?

The most commonly omitted context and one of the most consequential. An answer assuming a different major version will be confidently wrong in a way that looks entirely reasonable, and stating them costs one line.

How much surrounding code?

The whole function, plus anything it calls that you wrote. A single line is rarely enough, since the value causing the problem usually arrived from somewhere else, and that somewhere is the actual cause.

What should you not include?

The entire repository, which dilutes attention and pushes the relevant part into the middle where it is read least reliably. Relevant context beats complete context consistently.

Credentials also should not travel, and they end up pasted more often than anybody admits.

What is the request worth making?

Causes rather than fixes. Asking for the two most likely explanations, with how to confirm each, produces something you can act on and check, where asking for a fix produces a change you cannot evaluate.

Does it help to say what you have already tried?

Considerably, and it is the most commonly omitted item. A list of what you have ruled out removes those possibilities from consideration and pushes the answer past the obvious causes you have already eliminated.

Without it, the first suggestion is nearly always something you tried twenty minutes ago, which is demoralising and wastes a round. Three lines saying what you checked and what the result was changes the second attempt into something genuinely new, and it also forces you to notice whether your elimination was actually conclusive.

What is the test of a good prompt?

Whether somebody who has never seen your project could follow it. If they would need to ask a question before answering, the answer you get instead is a guess at whatever they would have asked.