From 8e80a5019bafe24a691fe9df036599ad51a3ab08 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 14 Mar 2012 13:42:43 +0100 Subject: [PATCH] add error handling --- debian_build.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/debian_build.py b/debian_build.py index 69e38b2..4a23adf 100755 --- a/debian_build.py +++ b/debian_build.py @@ -466,10 +466,18 @@ if __name__ == '__main__': # build was succesful, now let's tag it if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'): cmd = ['/usr/bin/git', 'tag', version] - subprocess.check_call(cmd) + try: + subprocess.check_call(cmd) + except: + logger_error('Could not tag repository.') + exit_error() cmd = ['/usr/bin/git', 'push', 'origin', version] - subprocess.check_call(cmd) - # FIXME: intercept failures + try: + subprocess.check_call(cmd) + except: + logger_error('Could not push tag.') + exit_error() + # finally exit_ok() -- 2.39.5