diff --git a/base/manifest.py b/base/manifest.py index e756626..a51f826 100644 --- a/base/manifest.py +++ b/base/manifest.py @@ -62,5 +62,5 @@ class Manifest(object): self.validation_error(e.message, e.path) def validation_error(self, message, json_path=None): - from common.exceptions import ManifestError - raise ManifestError(message, self.path, json_path) + from common.exceptions import ManifestError + raise ManifestError(message, self.path, json_path) diff --git a/common/exceptions.py b/common/exceptions.py index c82950f..33f0df6 100644 --- a/common/exceptions.py +++ b/common/exceptions.py @@ -8,8 +8,8 @@ class ManifestError(Exception): def __str__(self): if self.json_path is not None: - path = '.'.join(self.json_path) - return ('{msg}\n\tFile: {file}\n\tJSON path: {jsonpath}' + path = '.'.join(map(str, self.json_path)) + return ('{msg}\n File path: {file}\n JSON path: {jsonpath}' .format(msg=self.message, file=self.manifest_path, jsonpath=path)) return '{file}: {msg}'.format(msg=self.message, file=self.manifest_path) @@ -19,7 +19,7 @@ class TaskListError(Exception): self.message = message def __str__(self): - return "Error in tasklist: {0}".format(self.message) + return 'Error in tasklist: {msg}'.format(msg=self.message) class TaskError(Exception):