]> jfr.im git - erebus.git/commitdiff
urls - fix error handling
authorJohn Runyon <redacted>
Thu, 24 Aug 2023 01:33:07 +0000 (19:33 -0600)
committerJohn Runyon <redacted>
Thu, 24 Aug 2023 01:33:07 +0000 (19:33 -0600)
modules/urls.py

index e790979fa11267e6f8a501e6a19861f4a8e900c9..cfcd45f7fa5126675088966c55f7c94e4834ceb9 100644 (file)
@@ -221,8 +221,10 @@ def goturl(url):
                        return None
        except urllib2.HTTPError as e:
                return 'Error: %s %s' % (e.code, e.reason)
+       except urllib2.URLError as e:
+               return 'Error: %s' % (e.reason)
        except Exception as e:
-               return 'Error: %r' % (e.message)
+               return 'Error: %r' % (e.args)
 
 url_regex = (
        re.compile(r'https?://[^/\s]+\.[^/\s]+(?:/\S+)?'),