ErrorCodes 1.0 - Product details
Two products, really: a Cocoa app and a Perl script, which can give you human-readable descriptions of Mac OS error codes, if available, or error codes for (partial) names or descriptions.
Free! Click here to download. Runs in Mac OS X 10.2 or higher.
It works by parsing the MacErrors.h header file, located inside the CarbonCore framework, which lives inside the CoreServices framework in the System/Library folder.
It has been there since 10.2, so these tools work as long as the header file stays put. ;-) Which is the case for 10.3 and 10.4, so I guess it won't move anymore.
The advantage of this approach is, that you will always have the current definitions of error codes. It is not a static database of some kind!
About the Cocoa app
ErrorCodes will allow you to walk through the range of valid error codes. If you type a number, it will display name and description, if available.
About the Perl script
Install it in a location which is in your PATH, e.g. /usr/local/bin, so you can simply invoke it by typing 'oserr ... ' in the Terminal.
The script accepts multiple command-line arguments, which it tries to match (case-insensitively) against every line in the MacErrors.h file. This way, you can ask it to find error codes as well as (partial) descriptions.
Example: if you type
oserr -39
you will get
MacErrors.h: eofErr = -39, /*End of file*/