aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/util.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube/util.py')
-rw-r--r--youtube/util.py6
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