The exit code (number) is encoded in $?. The message is not available, because it's merely part of whatever program you ran. You could try capturing STDERR from it.
Caution: Contents may have been coded under pressure.
Comment on Re: how to retrieve the error message returned by the system command