web.isgd() now throws an error when it cant shorten a URL
This commit is contained in:
parent
28345b9c56
commit
72ed3c504f
5 changed files with 36 additions and 15 deletions
|
@ -1,8 +1,6 @@
|
|||
# Plugin by Lukeroge
|
||||
|
||||
from util import hook
|
||||
from urllib2 import HTTPError
|
||||
from util.web import isgd
|
||||
from util import hook, http, web
|
||||
|
||||
|
||||
@hook.command
|
||||
|
@ -10,6 +8,6 @@ def shorten(inp):
|
|||
"shorten <url> - Makes an is.gd shortlink to the url provided."
|
||||
|
||||
try:
|
||||
return isgd(inp)
|
||||
except (HTTPError):
|
||||
return "Could not shorten '%s'!" % inp
|
||||
return web.isgd(inp)
|
||||
except (web.ShortenError, http.HTTPError) as error:
|
||||
return error
|
||||
|
|
Reference in a new issue