web.isgd() now throws an error when it cant shorten a URL

This commit is contained in:
Luke Rogers 2012-10-13 12:10:02 +13:00
parent 28345b9c56
commit 72ed3c504f
5 changed files with 36 additions and 15 deletions

View file

@ -32,4 +32,9 @@ def fact(inp, say=False, nick=False):
attempts += 1
continue
return "%s - %s" % (fact, web.isgd(link))
try:
url = web.isgd(link)
except (web.ShortenError, http.HTTPError):
url = link
return "%s - %s" % (fact, url)