Sadly, that's pretty normal; you'd have to check the src code if you really want to know.
The main thing to know is that (in *nix) there is an unwritten (AFAICR) convention that 0 (zero) means success, any other value is an issue; some times just a warning, sometimes a failure.
If writing code wrappers, then if a cmd exit code != 0, log it and exit the current process and/or try to handle it gracefully.
I'm afraid its just one of those things you learn by experience.
NB: non-zero values mean different things for each cmd; zero is the only 'common' one.