Bug 1476053 - Handle invalid json in metadata updates, r=ato

Sometimes we get errors that result in invalid json in the logs.
There's nothing reasonable to do about this during metadata updates
so just skip it

MozReview-Commit-ID: 4QuM7M3lXGv

--HG--
extra : rebase_source : 7e828a32c0a05338ff050f16ab6a91761e58d9b0
This commit is contained in:
James Graham 2018-07-23 19:13:41 +01:00
Родитель f380927ba7
Коммит 4443a88796
1 изменённых файлов: 5 добавлений и 1 удалений

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

@ -250,7 +250,11 @@ class ExpectedUpdater(object):
def update_from_raw_log(self, log_file):
action_map = self.action_map
for line in log_file:
data = json.loads(line)
try:
data = json.loads(line)
except ValueError:
# Just skip lines that aren't json
continue
action = data["action"]
if action in action_map:
action_map[action](data)