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.
Copy this into your AI tool
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.