SD error codes

While testing my SD card, I had to expose the error code provided by the Sd2Card 'card' in the class SDClass (\SD\SD.h)

class SDClass {
...
  Sd2Card card;
...
public:
int error(void) 
{ 
  return card.errorCode(); 
}

I'd like to suggest this be added to the code, since others might want to know what the error code is when their SD card fails.

Sounds like a good idea, if all errorcodes are documented, what they mean, cq how to solve (could be in a separate txt file, not in the SDclass)

robtillaart: Sounds like a good idea, if all errorcodes are documented, what they mean, cq how to solve (could be in a separate txt file, not in the SDclass)

currently, they are in \libraries\SD\utility\Sd2Card.h starting from line 95, so even the error function as it stands would provide some use/help

In the beginning I used error codes for debug in SdFat. They have not been the same from version to version.

Error codes have become useful for diagnosing hardware problems so I plan to implement a error code to text function in a future version of SdFat.

SD.h is a wrapper for an old version of SdFat so this won't help SD.h users.