1
0
mirror of https://github.com/l1ving/youtube-dl synced 2026-06-05 17:46:37 +08:00

Print traceback when raising UnavailableVideoError

An OSError or IOError generally indicates something a little more
wrong than a "simple" UnavailableVideoError, so print the actual
traceback that leads to the exception. Otherwise meaningful postmortem
debugging a bug report is essentially infeasible.
This commit is contained in:
John Hawkinson
2016-10-08 09:27:24 -04:00
Unverified
parent 1dd58e14d8
commit ca14b60aca
+1
View File
@@ -1701,6 +1701,7 @@ class YoutubeDL(object):
self.report_error('unable to download video data: %s' % error_to_compat_str(err))
return
except (OSError, IOError) as err:
traceback.print_exc()
raise UnavailableVideoError(err)
except (ContentTooShortError, ) as err:
self.report_error('content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))