Skip to content

Commit

Permalink
Handle parse errors in hoogle plugin. Fixes #78
Browse files Browse the repository at this point in the history
  • Loading branch information
LordAro committed Jun 30, 2018
1 parent 9debaf6 commit a1d3bb9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions csbot/plugins/hoogle.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def search_hoogle(self, e):
self.log.warn('invalid JSON received from Hoogle')
return

if 'parseError' in hresp.json():
e.reply(hresp.json()['parseError'].replace('\n', ' '))
return

allresults = hresp.json()['results']
totalresults = len(allresults)
results = allresults[0:maxresults]
Expand Down

0 comments on commit a1d3bb9

Please sign in to comment.