Add error codes and return error information to the cli