Bug 1326250 - Fix TypeError in PerformanceParser error logging (#2868)

Previously schema violations would result in:
`TypeError: not enough arguments for format string`

The exception `message` property is used instead of the `str`
representation, since the latter results in pages of log output
rather than just the human readable message:
https://github.com/Julian/jsonschema/blob/v2.6.0/jsonschema/exceptions.py#L59-L88
https://python-jsonschema.readthedocs.io/en/v2.6.0/errors/#jsonschema.exceptions.ValidationError.message
This commit is contained in:
Ed Morley 2017-10-24 15:54:53 +01:00 коммит произвёл GitHub
Родитель 4acbfb17c0
Коммит 1c71f301ca
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -494,9 +494,8 @@ class PerformanceParser(ParserBase):
except ValueError:
logger.warning("Unable to parse Perfherder data from line: %s",
line)
except jsonschema.ValidationError:
except jsonschema.ValidationError as e:
logger.warning("Perfherder line '%s' does not comply with "
"json schema: %s", line)
# don't mark as complete, in case there are multiple performance
# artifacts
# self.complete = True
"json schema: %s", line, e.message)
# Don't mark the parser as complete, in case there are multiple performance artifacts.