Error messages and codes are output to stderr before the command exits. Most error codes will result in a command return code of 1, while a successful execution will result in a return code of 0. The one exception is that an unknown error will result in a return code of 254.