Fix bug in ManifestError __str__ function

+ some formatting fixes
This commit is contained in:
Anders Ingemann 2014-01-05 15:29:30 +01:00
parent e1881da2bc
commit 039a35a344
2 changed files with 5 additions and 5 deletions

View file

@ -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)

View file

@ -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):