~brian-murray/ubuntu-archive-tools/mir-bug-creation-improvements

« back to all changes in this revision

Viewing changes to phased-updater

  • Committer: Steve Langasek
  • Date: 2015-06-26 18:04:00 UTC
  • mfrom: (966.1.1 upstream)
  • Revision ID: steve.langasek@canonical.com-20150626180400-orwefjwatf4ba0xr
MergeĀ lp:~brian-murray/ubuntu-archive-tools/pu-json-decode-error

Show diffs side-by-side

added added

removed removed

Lines of Context:
385
385
    if new_buckets_file.getcode() != 200:
386
386
        logging.error('HTTP error retrieving %s' % new_buckets_url)
387
387
        return 'error'
388
 
    new_buckets_data = json.load(new_buckets_file)
 
388
    try:
 
389
        new_buckets_data = json.load(new_buckets_file)
 
390
    except json.decoder.JSONDecodeError:
 
391
        logging.error('Error getting new buckets at %s' % new_buckets_url)
 
392
        return 'error'
389
393
    if 'error_message' in new_buckets_data.keys():
390
394
        logging.error('Error getting new buckets at %s' % new_buckets_url)
391
395
        return 'error'
462
466
    if rate_file.getcode() != 200:
463
467
        logging.error('HTTP error retrieving %s' % rate_url)
464
468
        return 'error'
465
 
    rate_data = json.load(rate_file)
 
469
    try:
 
470
        rate_data = json.load(rate_file)
 
471
    except json.decoder.JSONDecodeError:
 
472
        logging.error('Error getting rate at %s' % rate_url)
 
473
        return 'error'
466
474
    if 'error_message' in rate_data.keys():
467
475
        logging.error('Error getting rate at %s' % rate_url)
468
476
        return 'error'