use global GrumbleError for web exceptions
This commit is contained in:
@@ -5,6 +5,7 @@ author: mutantmonkey <mutantmonkey@mutantmonkey.in>
|
||||
"""
|
||||
|
||||
from urllib.error import HTTPError
|
||||
from tools import GrumbleError
|
||||
import web
|
||||
import json
|
||||
|
||||
@@ -20,8 +21,7 @@ def fcc(phenny, input):
|
||||
req = web.get("http://callook.info/{0}/json".format(web.quote(callsign)))
|
||||
data = json.loads(req)
|
||||
except (HTTPError, IOError, ValueError):
|
||||
phenny.say("THE INTERNET IS FUCKING BROKEN. Please try again later.")
|
||||
return
|
||||
raise GrumbleError("THE INTERNET IS FUCKING BROKEN. Please try again later.")
|
||||
|
||||
if len(data) <= 0 or data['status'] == 'INVALID':
|
||||
phenny.reply('No results found for {0}'.format(callsign))
|
||||
|
||||
Reference in New Issue
Block a user