Prettier exception handling
This commit is contained in:
parent
f26e995f58
commit
8517d62b45
1 changed files with 3 additions and 3 deletions
|
@ -40,14 +40,14 @@ def urlparse(url):
|
||||||
if "/auswertung/pix/popup.php/" in url:
|
if "/auswertung/pix/popup.php/" in url:
|
||||||
return "http://www.planetromeo.com/img/usr/%s" % url[52:82]
|
return "http://www.planetromeo.com/img/usr/%s" % url[52:82]
|
||||||
else:
|
else:
|
||||||
raise ValueError("%s is not a valid URL.")
|
raise ValueError("%s is not a valid URL" % url)
|
||||||
|
|
||||||
def processURL(url, sender = False, geturls = False, verbose = False, shutup = False):
|
def processURL(url, sender = False, geturls = False, verbose = False, shutup = False):
|
||||||
verboselog("Processing URL %s..." % url, verbose)
|
verboselog("Processing URL %s..." % url, verbose)
|
||||||
try:
|
try:
|
||||||
purl = urlparse(url)
|
purl = urlparse(url)
|
||||||
except ValueError:
|
except ValueError as e:
|
||||||
log("Notice: %s is not a valid URL. Skipping." % url, shutup)
|
log("Notice: %s. Skipping." % e, shutup)
|
||||||
else:
|
else:
|
||||||
if purl == urlparse(url):
|
if purl == urlparse(url):
|
||||||
log("Warning: You may have copied the image URL rather than the link URL from the message window. Use the link URL instead!", shutup)
|
log("Warning: You may have copied the image URL rather than the link URL from the message window. Use the link URL instead!", shutup)
|
||||||
|
|
Loading…
Reference in a new issue