fix(dl): always report full error trace for download worker failures

Previously, unexpected errors only showed a generic message without the actual exception details or traceback. Simplify the error handler to always include the exception type/message and print the full trace.
This commit is contained in:
imSp4rky
2026-04-12 22:32:23 +00:00
parent 4179b9045e
commit cb3535215d

View File

@@ -2113,24 +2113,15 @@ class dl:
except Exception as e: # noqa
error_messages = [
":x: Download Failed...",
f" {type(e).__name__}: {e}",
]
if isinstance(e, EnvironmentError):
error_messages.append(f" {e}")
if isinstance(e, ValueError):
error_messages.append(f" {e}")
if isinstance(e, (AttributeError, TypeError)):
console.print_exception()
else:
if hasattr(e, "returncode"):
error_messages.append(f" Binary call failed, Process exit code: {e.returncode}")
error_messages.append(
" An unexpected error occurred in one of the download workers.",
)
if hasattr(e, "returncode"):
error_messages.append(f" Binary call failed, Process exit code: {e.returncode}")
error_messages.append(" See the error trace above for more information.")
if isinstance(e, subprocess.CalledProcessError):
# CalledProcessError already lists the exception trace
console.print_exception()
console.print(Padding(Group(*error_messages), (1, 5)))
console.print_exception()
if self.debug_logger:
self.debug_logger.log_error(