Documentation · Chapter 03

Understand an error
without panic.

An error is a clue about the step that could not finish. Start with the first error, not the last consequence.

You will change one element at a time, in an exact file, then verify the result.

404 and 500 tell different stories

404

No route matches the requested address. Check the URL, HTTP method, and src/routes/WebApp.php.

500

The route was generally found, but code failed. Read the development error and terminal.

The six-question method

  1. 1
    Is the server running?

    The terminal must still be running aml serve.

  2. 2
    Is the address exact?

    Compare /about and /About: letter case may matter depending on the system.

  3. 3
    Does the route exist?

    aml routes

  4. 4
    Is the class imported?

    Check use App\Controllers\AboutController;

  5. 5
    Does the method exist?

    The route requests index: the controller must have public function index(...).

  6. 6
    Does the view have the right name?

    about.php must exactly match view('about.php').

Frequent failures and fixes

Class AboutController not foundadd/fix the use import
Action de route invalidecheck the method name
View not found: about.phpcreate src/views/about.php
Undefined variable $projectNamepass the key through view()
Parse errorlook for a missing parenthesis, brace, or ;

Create an intentional failure

In the /about route, temporarily write 'show' instead of 'index'. Reload, read the error, then restore 'index'. This exercise teaches you to recognize a broken route–action connection without guessing.

In production

Internal details must remain hidden from visitors. Detailed screens are for development; logs retain information needed for diagnosis.