Fix the isolated exception message

Exception's error message should be put right after the Exception
with a bracket, othersize it will be ignored.

Change-Id: I0be28c20ff21805d9a1a52b702cf497df7b9069e
This commit is contained in:
zhufl 2020-12-04 15:15:39 +08:00
parent 7376520e26
commit b4b666cbbd
1 changed files with 3 additions and 4 deletions

View File

@ -67,15 +67,14 @@ class JobBinaryManager(object):
def get_job_binary(self, name): def get_job_binary(self, name):
res = self.job_binaries.get(name) res = self.job_binaries.get(name)
if res is None: if res is None:
raise ex.InvalidDataException raise ex.InvalidDataException(_("Invalid job binary"))
(_("Invalid job binary"))
return res return res
def get_job_binary_by_url(self, url): def get_job_binary_by_url(self, url):
url = urlparse.urlparse(url) url = urlparse.urlparse(url)
if not url.scheme: if not url.scheme:
raise ex.InvalidDataException raise ex.InvalidDataException(
(_("Job binary url must have a scheme")) _("Job binary url must have a scheme"))
return self.get_job_binary(url.scheme) return self.get_job_binary(url.scheme)