Chromium Code Reviews
Descriptionjson: Improve error handling and adding ability to limit log output.
When json parsing fails it can be hard to see the reason why. Adding
some explicit handling of common error cases (empty file and None input)
makes it easier to see the issue.
The error output should always be included even when add_json_log is
false otherwise things like empty or missing json files are silently
ignored and cause very weird and hard to debug issues later in recipes
code. Adding this reveals numerous issues where this state is being
accidentally ignored already.
With large json files there is the temptation to use add_json_log=False
to reduce the output. This makes it very hard to debug issues with the
json as you have no idea what the contents even looked like. By adding a
max output size allows making this trade off more easily. The line
snipping code is in utilities to allow it to be used in other similar
places.
Patch Set 1 #
Total comments: 11
Messages
Total messages: 8 (3 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||