use global GrumbleError for web exceptions

This commit is contained in:
mutantmonkey
2012-06-01 22:17:09 -07:00
parent 28cde318a8
commit 9add0985ec
16 changed files with 85 additions and 81 deletions

View File

@@ -7,6 +7,7 @@ http://github.com/randynobx/phenny/
"""
from urllib.error import URLError, HTTPError
from tools import GrumbleError
import re
import web
@@ -19,7 +20,7 @@ def wuvt(phenny, input) :
playing = web.get('http://www.wuvt.vt.edu/playlists/latest_track.php')
djpage = web.get('http://www.wuvt.vt.edu/playlists/current_dj.php')
except (URLError, HTTPError):
return phenny.reply('Cannot connect to wuvt')
raise GrumbleError('Cannot connect to wuvt')
play= r_play.search(playing)
song = play.group(1)
artist = play.group(2)