HOW-TO 199 · Productivity, HR and Technical Skills

How to identify and fix errors in computer code

A script fails and an error message is hard to interpret. Follow these steps to get a first version and make sure it is suitable for your purpose.

Before you start

FILE OR SOURCE NEEDED: your code and error message. Open a new chat. Select + or the paperclip by the message box, choose Upload file, select your file and wait for its name to appear. Then paste the prompt. If uploads are unavailable, paste approved text or figures instead, or use an approved tool that accepts the file.

YOUR READY-TO-USE PROMPT

Copy this into your AI tool

I need to identify and fix errors in computer code. I am a beginner, so explain unfamiliar terms in plain English. Start by asking short questions, one by one, and pause after each answer. Find out the code snippet, the exact error, the language or version, and the expected behaviour. If there is a file, first confirm you can read it and ask for any missing information. When you have enough details, complete the task this way: Diagnose the exact error we discuss in the code snippet we discuss using the language or version we discuss. Explain the probable cause, show a minimal corrected example, and describe why the change should produce the expected behaviour we discuss. If details are missing, ask for them; do not pretend the code was executed. Use only what I provide or sources you can actually verify. Do not make up facts, figures, names or approvals. If you cannot create the requested file or perform a tool action, tell me exactly how to complete that part myself. Let me check the first version and make changes before we finish. Suggest only changes supported by the code and error message I show. Provide a small test before a wider change.
Paste it into an AI application and answer its questions.
Example, follow-up prompt and final checks

Example conversation

AI might ask: Do you have the material you want me to work with?

You might reply: Yes, I can attach it now.

Example result

Error: KeyError on 'Amount' | Test whether column exists first.

Improve your result

Use a safe test copy before touching live systems, and confirm any change with the authorised owner.

Suggest a small test that would catch the same bug again.

Before you use it

Test in a safe environment and review security effects.