aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/YoutubeDL.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-12-20 05:27:38 +0600
committerSergey M․ <dstftw@gmail.com>2015-12-20 05:27:38 +0600
commit7f8b271465df75bb1f83cb181dc45fee5fe02cf9 (patch)
treea17694aae937027a453b6d279dff3be5530e73e9 /youtube_dl/YoutubeDL.py
parentfdae2358581be6f80ac5fd20b1062e87a8797f46 (diff)
downloadyoutube-dl-7f8b271465df75bb1f83cb181dc45fee5fe02cf9.tar.xz
Properly convert errors to strings
Diffstat (limited to 'youtube_dl/YoutubeDL.py')
-rwxr-xr-xyoutube_dl/YoutubeDL.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index c642a1fbf..26b3adb02 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -48,6 +48,7 @@ from .utils import (
determine_ext,
DownloadError,
encodeFilename,
+ error_to_str,
ExtractorError,
format_bytes,
formatSeconds,
@@ -681,7 +682,7 @@ class YoutubeDL(object):
raise
except Exception as e:
if self.params.get('ignoreerrors', False):
- self.report_error(compat_str(e), tb=compat_str(traceback.format_exc()))
+ self.report_error(error_to_str(e), tb=compat_str(traceback.format_exc()))
break
else:
raise
@@ -1459,7 +1460,7 @@ class YoutubeDL(object):
if dn and not os.path.exists(dn):
os.makedirs(dn)
except (OSError, IOError) as err:
- self.report_error('unable to create directory ' + compat_str(err))
+ self.report_error('unable to create directory ' + error_to_str(err))
return
if self.params.get('writedescription', False):
@@ -2039,4 +2040,4 @@ class YoutubeDL(object):
(info_dict['extractor'], info_dict['id'], thumb_display_id, thumb_filename))
except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
self.report_warning('Unable to download thumbnail "%s": %s' %
- (t['url'], compat_str(err)))
+ (t['url'], error_to_str(err)))