Return error when error occurs by raising exception

Review URL: http://codereview.chromium.org/2819052
This commit is contained in:
Chris Sosa 2010-07-19 11:12:20 -07:00
parent 90f689c2d3
commit 92d3779dff

View File

@ -315,9 +315,9 @@ def main(argv):
except gflags.FlagsError, e : except gflags.FlagsError, e :
_PrintUsageAndDie(str(e)) _PrintUsageAndDie(str(e))
package_list = gflags.FLAGS.packages.split(' ') package_list = gflags.FLAGS.packages.split()
if gflags.FLAGS.commit_ids: if gflags.FLAGS.commit_ids:
commit_id_list = gflags.FLAGS.commit_ids.split(' ') commit_id_list = gflags.FLAGS.commit_ids.split()
else: else:
commit_id_list = None commit_id_list = None
_CheckSaneArguments(package_list, commit_id_list, command) _CheckSaneArguments(package_list, commit_id_list, command)
@ -347,11 +347,12 @@ def main(argv):
worker.CommitChange(_GIT_COMMIT_MESSAGE % (package, commit_id)) worker.CommitChange(_GIT_COMMIT_MESSAGE % (package, commit_id))
except (OSError, IOError), e: except (OSError, IOError), e:
print ('An exception occurred %s\n' print ('An exception occurred\n'
'Only the following packages were revved: %s\n' 'Only the following packages were revved: %s\n'
'Note you will have to go into %s' 'Note you will have to go into %s'
'and reset the git repo yourself.' % 'and reset the git repo yourself.' %
(e, package_list[:index], _CHROMIUMOS_OVERLAYS_DIRECTORY)) (package_list[:index], _CHROMIUMOS_OVERLAYS_DIRECTORY))
raise e
elif command == 'push': elif command == 'push':
_PushChange() _PushChange()