diff options
author | Jesús <heckyel@hyperbola.info> | 2021-07-28 23:45:19 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-07-28 23:45:19 -0500 |
commit | f5f9b1c18172327ec310efc9274db30959ba334e (patch) | |
tree | 8a1ba232fef71c76e4c016b7403d9336c3daed3d /youtube/util.py | |
parent | d0e3adab0115c547eb58d34337dca7bfce629be2 (diff) | |
download | yt-local-f5f9b1c18172327ec310efc9274db30959ba334e.tar.lz yt-local-f5f9b1c18172327ec310efc9274db30959ba334e.tar.xz yt-local-f5f9b1c18172327ec310efc9274db30959ba334e.zip |
Cleaner channel-checking console error messages when Tor is closed
by James Taylor <user234683@users.noreply.github.com>
Diffstat (limited to 'youtube/util.py')
-rw-r--r-- | youtube/util.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/youtube/util.py b/youtube/util.py index e62d575..daec2df 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -194,7 +194,11 @@ class HTTPAsymmetricCookieProcessor(urllib.request.BaseHandler): class FetchError(Exception): def __init__(self, code, reason='', ip=None, error_message=None): - Exception.__init__(self, 'HTTP error during request: ' + code + ' ' + reason) + if error_message: + string = code + ' ' + reason + ': ' + error_message + else: + string = 'HTTP error during request: ' + code + ' ' + reason + Exception.__init__(self, string) self.code = code self.reason = reason self.ip = ip |