List of exit values for error statuses.

Alexander Belchenko bialix at
Tue Feb 28 20:09:55 UTC 2012

David Ingamells пишет:
> Hi all!
> Is there a list + explanation somewhere of the possible exit values for 
> bzr? I've tried searching of the Bazaar documentation for the possible 
> terms I can think of that might be used to no avail. There is some 
> sporadic mention of exit values - e.g. "missing" describes its special 
> exit values 1 and 0.
> In particular I need to detect errors that might be caused by a flaky 
> remote internet connection so that my tooling can retry the command. 
> I've seen exit value 3 being returned by a failed push but cannot know 
> how many other conditions can also result in the same exit value.
> Thanks in advance

Exit code 3 is error code, for sure.

bzrlib/ has the following:

# return codes from the bzr program

Error codes 3 and 4 returned only on user error or internal error in 
the code (which lead to Traceback).

What is 1 and 2 depends on the command, I guess.
I'm afraid you have to inspect code for each interesting command to 
find out whether it returns anything other than EXIT_OK.

More information about the bazaar mailing list