From: Benjamin Drung Date: Wed, 22 Jan 2014 12:33:47 +0000 (+0100) Subject: gentoo_build: Print a nice error message if pushing a tag fails. X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=e0f9b840ca13fd6f054847012d1359c495216040;p=profitbricks%2Fjenkins-build-scripts.git gentoo_build: Print a nice error message if pushing a tag fails. --- diff --git a/gentoo_build b/gentoo_build index 4809883..4de5d5a 100755 --- a/gentoo_build +++ b/gentoo_build @@ -408,7 +408,11 @@ def push_tag(logger, repo, tag, dry_run): "requested.".format(tag=tag)) else: logger.info("Pushing tag {tag}...".format(tag=tag)) - repo.git.push("origin", tag) + try: + repo.git.push("origin", tag) + except git.GitCommandError as error: + logger.error('Could not push tag: ' + str(error)) + sys.exit(1) if __name__ == '__main__': main()