handle errors formatting review data output
Add an exception handler to catch formatting errors, just in case. Change-Id: Ia457f5ab8dafedf24366fb2e073bd174ef40d60f Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
fd60557b95
commit
5196790cfd
@ -136,7 +136,11 @@ def list_gerrit_patches(title, template, query):
|
||||
for r in reviews:
|
||||
if 'topic' not in r:
|
||||
r['topic'] = ''
|
||||
print(template.format(**r))
|
||||
try:
|
||||
print(template.format(**r))
|
||||
except Exception as err:
|
||||
print('Could not format review data: {}'.format(err))
|
||||
print(r)
|
||||
print('{} results\n'.format(len(reviews)))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user