Skip to content

Commit

Permalink
Bitly JSON exception handling
Browse files Browse the repository at this point in the history
Bitly JSON exception handling
  • Loading branch information
grantat authored Sep 8, 2017
2 parents 696be56 + 73b2361 commit e3ace61
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/cdGetBitly.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ def GetBitlyJson(URL):
if(page.find(b'"error": "NOT_FOUND"') != -1):
break

jsonData = json.loads(page.decode())
try:
jsonData = json.loads(page.decode())
except:
logging.debug('Failed to load Bitly json')
continue

if(jsonData['status_code'] == 403):
continue
Expand Down

0 comments on commit e3ace61

Please sign in to comment.