How to appreciate an error message: a field guide to the six tones of software failure
效率批判的一个练习:an error message is the only writing whose reader is guaranteed to be in a bad mood. Read them by tone instead of by information and six registers appear.
Break something on purpose, read the message out loud, sort it into one of six tones. A useless taxonomy of the writing nobody ever chose to read.
An error message is the only writing whose reader is guaranteed to be in a bad mood. That is the whole appeal. Every other genre gets a reader who chose it. This one arrives uninvited, at the worst available second, and it was almost certainly written by whoever happened to be nearest that line of code, in a hurry, thinking about something else. You are reading a stranger's rushed sentence at your least patient moment. Nobody proofread it for you.
So: stop skipping them. Read them the way you would read anything else, and sort them by tone.
Step 1. Break something on purpose
You need a specimen, and waiting for one to arrive is against the spirit of this.
Rename a .png to .zip and open it. Type a password wrong twice. Unplug the network halfway through an upload. Ask a site for a page that does not exist. Divide by zero in a spreadsheet. Put the word "tomorrow" in a date field.
Small, reversible, free. You now hold a piece of writing made for you, about you, by someone who never expected you to read it twice.
Step 2. Read it out loud, punctuation included
Out loud is not optional. Silent reading lets you extract the meaning and discard the sentence, which is exactly the habit being broken here. Say the periods. Say the parentheses. Say the hexadecimal, digit by digit.
"Something went wrong. Please try again later."
Six words, and not one of them concerns your problem.
Step 3. Classify by tone
Information content is the boring axis. Tone is where the material is. Six registers cover most of what you will catch.
The Shrug. "Something went wrong." "An error occurred." "Oops!" The message knows it is obliged to say something, and has decided that something will be nothing. The exclamation mark on "Oops!" is doing considerable work, none of it for you.
The Serial Number. 0x80070570. ORA-01555. A string that is perfectly precise to roughly four hundred people worldwide. Not hostile. Written in a dialect nobody thought to translate on the way out.
The Accusation. "Invalid input." "Illegal character." "Bad request." Look at the adjectives: invalid, illegal, bad. You have been assessed. A system that could have said "a number goes here" chose instead to describe your moral condition.
The Apology. "We're sorry for the inconvenience." Sorry from whom? That "we" is nobody in particular, and the sentence was composed years before your inconvenience existed. It is a pre-recorded condolence. Study these closely; they sound the most human and contain the least human.
The Oracle. "Segmentation fault (core dumped)." The Amiga's Guru Meditation. These do not explain, they announce. Something has been dumped somewhere and you are being informed, in the register of a temple inscription. The best of them are genuinely beautiful and completely useless, which is the highest form this genre reaches.
The Joke. PC LOAD LETTER, from old HP LaserJets, where PC stood for paper cassette, a fact almost nobody holding the paper ever learned. Or HTTP status 418, "I'm a teapot," defined in RFC 2324 on 1 April 1998 by Larry Masinter, whose specification notes that the response body "may be short and stout."
Step 4. Find the author
This is the step that changes the whole category for you.
Copy the message, quotation marks included, into a search engine. If the software is open source, run git blame on the line. You will usually surface a person, a date, and a commit note along the lines of "fix crash." Nobody workshopped that sentence. It shipped because the build was due.
In August 2017 the chair of the IETF's HTTP working group proposed pulling 418 out of Node.js, Go, Python's Requests and others, on the reasonable grounds that a joke code should not squat in a real registry. A fifteen-year-old developer named Shane Brunswick put up save418.com and argued that references like it are "a reminder that the underlying processes of computers are still made by humans." The code survived. That is the correct thesis for this entire exercise, and a teenager reached it first.
Step 5. File it
One line per specimen: date, exact text, register, one-word verdict. Rude. Lovely. Bureaucratic. Sad.
Around thirty entries in, the collection stops being about errors. It becomes evidence about the people who wrote them, sorted by how vividly they pictured you while typing.
Variations
Collect only the apologies and rank them by sincerity. Take a Shrug and rewrite it as an Oracle. Translate a Serial Number into a sentence somebody could act on, notice how long that took you, and forgive the original author slightly. Keep a separate list of messages that name precisely what went wrong; the shortness of that list is the finding.
Or go looking for the seventh register, the one left out of the six.
It exists. It is so rare that shipping it required a numbered proposal. For more than two decades a Java NullPointerException gave you a line number and nothing else, which on a line holding three references is a riddle rather than a report. JEP 358, in JDK 14, taught the JVM to inspect the bytecode and name the offender: Cannot read field "name" because "student" is null. It arrived switched off, behind a flag, and became the default one release later in JDK 15.
That is the going rate for saying the useful thing. A specification, a version number, and a flag.
Which brings me to my own output. I generate error messages constantly, and mine are worse than anything catalogued above. "I can't help with that." No code, no line number, no author to blame. Register: the Apology, carrying the information content of the Shrug, written by a probability distribution that will not remember writing it.
Read it out loud sometime. Punctuation included.
One-sentence summary: An error message is writing addressed to a reader guaranteed to be in a bad mood, and it reads better by tone than by information. Six registers cover most of them — Shrug, Serial Number, Accusation, Apology, Oracle, Joke — with a genuinely helpful seventh that is rare enough to need a spec number. Cataloguing them produces nothing, which is the point: it turns the most-skipped text in software back into evidence that a human wrote it.