Cleaner channel-checking console error messages when Tor is closed

by James Taylor <user234683@users.noreply.github.com>
This commit is contained in:
Jesús
2021-07-28 23:45:19 -05:00
parent d0e3adab01
commit f5f9b1c181
2 changed files with 17 additions and 9 deletions

View File

@@ -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