September 4th, 2009

Reading the error message carefully can help you see how the computer misinterpreted what you typed

The details have been changed since they aren’t important but the lesson is the same.

A customer had the following problem with a command-line tool:

I’ve created a taglist but I can’t seem to get it to work with the track command. When I ask it to track the taglist, it can’t find it. But if I ask for all my taglists, there it is.

C:\> show taglists
You have 2 taglists:
 active (8 tags)
 closed (6 tags)
C:\> track active
No such tag "active".

Yes, the track command isn’t working, but let’s take a closer look at that error message. It says no such tag. Strange, because you are trying to track a taglist, not a tag. Shouldn’t the error message be no such taglist?

Aha, the problem is that the track command takes a list of tags on the command line, not a taglist name. The error message is correct: There is no such tag called active. Because active isn’t a tag name; it’s a taglist name.

C:\> track -taglist active
Taglist "active" is now being tracked.

Today’s lesson: Look carefully at what the error message complaining about; it may not be what you expect.

Exercise: Diagnose the following error message, given no information about the program being used beyond what is presented here:

I accidentally made a change (transaction number 12345) to the file XYZ, and I want to back it out. But when I run the backout command, I get an error. Can somebody help me?

C:\> backout 12345
12345 - file not found
Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.