From 9099a788cd7124024559c064e425ed9caef6e0ac Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Fri, 22 Jul 2016 16:28:12 -0700 Subject: [crosperf] Clean up exceptions. Found all instances of 'raise Exception' and changed them to raise something slightly more specific. Changed a few 'except Exception' statements appropriately as well. BUG=chromium:566255 TEST=None Change-Id: If2666bd55838342bc71431e5e6ab2157c2c9e125 Reviewed-on: https://chrome-internal-review.googlesource.com/270731 Commit-Ready: Caroline Tice Tested-by: Caroline Tice Reviewed-by: Yunlian Jiang --- test_gdb_dejagnu.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test_gdb_dejagnu.py') diff --git a/test_gdb_dejagnu.py b/test_gdb_dejagnu.py index a1c44dc9..4f44527f 100755 --- a/test_gdb_dejagnu.py +++ b/test_gdb_dejagnu.py @@ -32,12 +32,12 @@ class DejagnuAdapter(object): '--minilayout', '--jobs=8'] ret = setup_chromeos.Main(cmd) if ret: - raise Exception('Failed to checkout chromeos') + raise RuntimeError('Failed to checkout chromeos') ## Do cros_sdk and setup_board, otherwise build_tc in next step will fail. cmd = 'cd {0} && cros_sdk --download'.format(self._chromeos_root) ret = self._cmd_exec.RunCommand(cmd, terminated_timeout=9000) if ret: - raise Exception('Failed to create chroot.') + raise RuntimeError('Failed to create chroot.') def SetupBoard(self): cmd = './setup_board --board=' + self._board @@ -45,7 +45,7 @@ class DejagnuAdapter(object): cmd, terminated_timeout=4000) if ret: - raise Exception('Failed to setup board.') + raise RuntimeError('Failed to setup board.') def CheckGDB(self): args = [gdb_dejagnu.__file__, '--board=' + self._board, @@ -135,7 +135,7 @@ def ProcessArguments(argv): options = parser.parse_args(argv) if not options.board or not options.remote: - raise Exception('--board and --remote are mandatory options.') + raise SyntaxError('--board and --remote are mandatory options.') return options -- cgit v1.2.3