There is a list of Mac error codes in the Carbon CoreServices framework header file. To search it, you can just use grep, or the following shell script:
try this.
#!/bin/sh
# NOTE: Enter the following two lines as one line
# without ANY additional spaces:
/usr/bin/grep "$1" /System/Library/Frameworks/CoreServices.framework/
Versions/A/Frameworks/CarbonCore.framework/Headers/MacErrors.h
Give it a name, save it and make it executable (chmod script_name 755). Once saved, you can do something like this (assuming a script name of "errcode"):
% % errcode 5402
qtsBadDataErr = -5402, /* something is wrong with the data */