How about having Arduino IDE ship with an include file with standard error codes that could be used by libraries and sketches:
#ifndef ERRORCODES_H
#define ERRORCODES_H
//! \version 1.2
enum ErrorCode {
SUCCESS= 0,
ERROR_CHECKSUM= -9999,
ERROR_TIMEOUT= -9998,
ERROR_DISABLED= -9997,
ERROR_UNSUPPORTED= -9996,
ERROR_UNKNOWN_RSP= -9995,
ERROR_BAD_COMMAND= -9994,
ERROR_DIRECTORY= -9993,
ERROR_FILENAME= -9992,
ERROR_NOT_ANALOG_PIN= -9991,
ERROR_NOT_DIGITAL_PIN= -9990,
ERROR_NOT_INTERRUPT_PIN= -9989,
ERROR_NOT_PWM_PIN= -9988,
ERROR_NOT_SERIAL_PIN= -9987,
ERROR_READ= -9986,
ERROR_WRITE= -9985,
ERROR_BAD_PARAM= -9984,
ERROR_INIT1= -9983,
ERROR_INIT2= -9982,
ERROR_INIT3= -9981,
ERROR_NO_DATA= -9980,
ERROR_NO_MEMORY= -9979,
};
#endif // ERRORCODES_H