[utils] Better traceback for `ExtractorError`

pull/2986/head
pukkandan 3 years ago
parent 2807d1709b
commit 497d2fab6c
No known key found for this signature in database
GPG Key ID: 7EEE9E1E817D0A39

@ -749,7 +749,7 @@ class InfoExtractor(object):
errmsg = '%s: %s' % (errnote, error_to_compat_str(err))
if fatal:
raise ExtractorError(errmsg, sys.exc_info()[2], cause=err)
raise ExtractorError(errmsg, cause=err)
else:
self.report_warning(errmsg)
return False

@ -1076,9 +1076,10 @@ class ExtractorError(YoutubeDLError):
'' if expected else bug_reports_message())))
def format_traceback(self):
if self.traceback is None:
return None
return ''.join(traceback.format_tb(self.traceback))
return join_nonempty(
self.traceback and ''.join(traceback.format_tb(self.traceback)),
self.cause and ''.join(traceback.format_exception(self.cause)[1:]),
delim='\n') or None
class UnsupportedError(ExtractorError):

Loading…
Cancel
Save