Shortcuts, and reading an error
You will learn
How to read an error message part by part, and four shortcuts that save time.
An error message looks like noise, but it has 4 parts in the same order every time: the kind of error, what it says, the file and the line. The line is where the problem was noticed, so the cause can sit just above it: start reading 1 line before. Keep 4 shortcuts at hand: Cmd+S saves, Cmd+Z undoes, Ctrl+C stops a program in the terminal, and the up arrow brings back the previous command. When you ask your agent for help, paste the whole message, not a retelling of it.
Try it
In the spec, find ERROR_LINE and START_LINE. Change START_LINE to 15 and run the player: the test that wants the start one line above the error fails. Then put it back to 13.
An error message split into its four parts, in the order you read them, and where to start reading. Lesson 6 of the vibecoding course.
specs/vibecoding/read_an_error.t27
// SPDX-License-Identifier: Apache-2.0
; specs/vibecoding/read_an_error.t27 -- lesson 6 of the vibecoding course: shortcuts, and reading an error
; An error message has four parts, and they come in the same order every time you read it:
; what kind of error, what it says, which file, which line. The line is where the problem was
; noticed, so the cause can sit just above it: open from one line before.
; ASCII only (L3), English only (LANG-EN).
; phi^2 + 1/phi^2 = 3 | TRINITY
module vc_read_an_error;
pub const PART_COUNT : u8 = 4;
pub const PARTS : [4]str = ["kind", "message", "file", "line"];
; Four shortcuts worth knowing on day one (Cmd on a Mac, Ctrl elsewhere).
pub const SHORTCUT_COUNT : u8 = 4;
pub const SHORTCUTS : [4]str = ["Cmd+S", "Cmd+Z", "Ctrl+C", "Up arrow"];
pub const SHORTCUT_MEANINGS : [4]str = [
"save the file",
"undo the last edit",
"stop a program running in the terminal",
"bring back the previous command"
];
; An error was reported at this line; read from one line before it.
pub const ERROR_LINE : u8 = 14;
pub const START_LINE : u8 = 13;
test an_error_has_four_parts_and_the_line_comes_last {
assert PART_COUNT == 4;
assert PARTS[0] == "kind";
assert PARTS[3] == "line";
}
test four_shortcuts_each_with_a_meaning {
assert SHORTCUT_COUNT == 4;
assert SHORTCUTS[2] == "Ctrl+C";
assert SHORTCUT_MEANINGS[2] == "stop a program running in the terminal";
assert SHORTCUT_MEANINGS[3] == "bring back the previous command";
}
test start_reading_one_line_above_the_reported_line {
assert START_LINE == ERROR_LINE - 1;
assert START_LINE < ERROR_LINE;
}
All lessons
Module 1 · What vibecoding is
You describe, an agent writes, you run it and check. What a program is, and five myths put to a test.
Module 2 · Your desk
An editor with an agent beside it, ten terminal commands, and reading an error message.
Module 3 · Save points with git
A commit is a save point, a branch is a safe try, and a key is a pair of which one stays private.
Module 4 · Prompting
The parts of a prompt, an example in place of an adjective, and one small step at a time.
Module 5 · The working loop
Four phases from idea to ship, the loop of ask, run, read and fix, and what to do when it is stuck.
Module 6 · A test as the judge
A test says yes or no, a planted bug shows the test works, and a diff is read before it is accepted.
Module 7 · The parts of an agent
What an agent answers with, what it can do with tools, and what it keeps between messages.
Module 8 · A first bot
A bot is a message loop, a bot comes from a spec, and a secret stays out of the repository and the prompt.
Module 9 · Your own project
A spec for your own idea, one thing measured after it runs, and an honest plan for the next month.