From c90d71dd44794f8499813804290d08d3fdae6a6f Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Tue, 4 Dec 2018 13:35:41 +0000 Subject: [PATCH] Raise ValueError, fix spacing --- lib/galaxy/util/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index 2c998a8a227..1229d390527 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -1363,7 +1363,7 @@ def size_to_bytes(size): size_re = re.compile(r'(?P[\d\.]+)\s*(?P[eptgmk]?(b|bytes?)?)?$') size_match = size_re.match(size.lower()) if size_match is None: - raise Exception("size_to_int: could not parse %s"%(size)) + raise ValueError("Could not parse string '%s'" % size) number = float(size_match.group("size")) multiple = size_match.group("multiple") if multiple == "" or multiple.startswith('b'): @@ -1381,7 +1381,7 @@ def size_to_bytes(size): elif multiple.startswith('e'): return int(number * 1024 ** 6) else: - raise Exception("size_to_bytes: unknown multipier %s in %s"%(multiple, size)) + raise ValueError("Unknown multiplier '%s' in '%s'" % (multiple, size)) def send_mail(frm, to, subject, body, config, html=None): """