HagiCode Fullstack

Quando algo quebra

Draft: this lesson is an outline and will be expanded.

Sooner or later a change will break something: a page goes blank, a button stops working, or the assistant shows an error message. This is normal and not a sign that you did something wrong. In this lesson you learn a calm routine for it. By the end you will know what to send the assistant, and when to stop and go back.

An error message is the text a program shows when it cannot do what it was asked. It looks unfriendly, but it is exactly what the assistant needs.

The routine

  1. Copy the error exactly. Select the full text and paste it. Do not retype it or summarise it. A single changed word can hide the cause.
  2. Say what you did and what you expected. For example: I asked for a contact form. After your change the contact page is blank. I expected the form.
  3. Ask for a fix, then check it. Look at the page again yourself, as you did before.
  4. Count your tries. If the same problem is still there after three tries, stop.

Go back instead of going on

After three failed tries, more attempts usually add more mess. Return to your last good save point and start that step again with a different request.

What you will do

  1. On purpose, ask the assistant for a change likely to cause trouble, such as Rename the home page file to start.html.
  2. Open the site and see what breaks.
  3. Copy any error text and the symptom into your next request, using the routine above.
  4. If the fix does not work after three tries, open GitHub Desktop and discard the uncommitted changes, which returns the folder to the last save point. Check the list of changes first, because discarded changes are lost for good.
  5. Ask again with a clearer request.

Check yourself

  • You pasted the error text without changing it.
  • You stopped after three failed tries and returned to a save point.
  • The site works again and you did not lose earlier commits.

What comes next

Go on to Check the result, where you decide whether the work is really finished.