mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 14:14:54 +01:00
[utils] Better traceback for ExtractorError
This commit is contained in:
parent
2807d1709b
commit
497d2fab6c
|
@ -749,7 +749,7 @@ def _request_webpage(self, url_or_request, video_id, note=None, errnote=None, fa
|
||||||
|
|
||||||
errmsg = '%s: %s' % (errnote, error_to_compat_str(err))
|
errmsg = '%s: %s' % (errnote, error_to_compat_str(err))
|
||||||
if fatal:
|
if fatal:
|
||||||
raise ExtractorError(errmsg, sys.exc_info()[2], cause=err)
|
raise ExtractorError(errmsg, cause=err)
|
||||||
else:
|
else:
|
||||||
self.report_warning(errmsg)
|
self.report_warning(errmsg)
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -1076,9 +1076,10 @@ def __init__(self, msg, tb=None, expected=False, cause=None, video_id=None, ie=N
|
||||||
'' if expected else bug_reports_message())))
|
'' if expected else bug_reports_message())))
|
||||||
|
|
||||||
def format_traceback(self):
|
def format_traceback(self):
|
||||||
if self.traceback is None:
|
return join_nonempty(
|
||||||
return None
|
self.traceback and ''.join(traceback.format_tb(self.traceback)),
|
||||||
return ''.join(traceback.format_tb(self.traceback))
|
self.cause and ''.join(traceback.format_exception(self.cause)[1:]),
|
||||||
|
delim='\n') or None
|
||||||
|
|
||||||
|
|
||||||
class UnsupportedError(ExtractorError):
|
class UnsupportedError(ExtractorError):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user