From 497d2fab6c25df04362e5fac8383acd28030a97b Mon Sep 17 00:00:00 2001 From: pukkandan Date: Tue, 8 Mar 2022 12:04:49 +0530 Subject: [utils] Better traceback for `ExtractorError` --- yt_dlp/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'yt_dlp/utils.py') diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py index 8256d543e..9406eb834 100644 --- a/yt_dlp/utils.py +++ b/yt_dlp/utils.py @@ -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): -- cgit v1.2.3