diff options
author | Caroline Tice <cmtice@google.com> | 2016-07-22 16:28:12 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-07-27 07:23:18 -0700 |
commit | 9099a788cd7124024559c064e425ed9caef6e0ac (patch) | |
tree | 87df663ff83ab398121cd66e9528422979a63cf6 /crosperf/field.py | |
parent | 19e119b46c14f57988ba3504369e815d3aab0122 (diff) | |
download | toolchain-utils-9099a788cd7124024559c064e425ed9caef6e0ac.tar.gz |
[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 <cmtice@google.com>
Tested-by: Caroline Tice <cmtice@google.com>
Reviewed-by: Yunlian Jiang <yunlian@google.com>
Diffstat (limited to 'crosperf/field.py')
-rw-r--r-- | crosperf/field.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crosperf/field.py b/crosperf/field.py index e25ffe30..bc92e2cc 100644 --- a/crosperf/field.py +++ b/crosperf/field.py @@ -68,7 +68,7 @@ class BooleanField(Field): return True elif value.lower() == 'false': return False - raise Exception("Invalid value for '%s'. Must be true or false." % + raise TypeError("Invalid value for '%s'. Must be true or false." % self.name) @@ -147,6 +147,6 @@ class EnumField(Field): def _Parse(self, value): if value not in self.options: - raise Exception("Invalid enum value for field '%s'. Must be one of (%s)" % + raise TypeError("Invalid enum value for field '%s'. Must be one of (%s)" % (self.name, ', '.join(self.options))) return str(value) |