Issue #20 resolved

provide hg command return code in exception in case of an error

Anonymous created an issue

In order to diffentiate between fatal and non fatal errors the return code of the underlying hg command should be easily accessible from the thrown exception.

Example: hg push yields an return code 1 in case no changes found. But it yields 255 in case the changes cannot be pushed due to a conflict.

Currently the error code is embedded into the exception message: raise Exception("Error running %s:\n\tErr: %s\n\tOut: %s\n\tExit: %s" % (cmd,err,out,proc.returncode))

It would be a nice idea to have a "HgException" which provided access to the elements through member variables

Comments (3)

  1. Log in to comment