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
parent 1dd58e14d8
commit c6c733d4a3

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