From cb3535215dba3b16128e8cafc1f85e3041ae4392 Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Sun, 12 Apr 2026 22:32:23 +0000 Subject: [PATCH] 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. --- unshackle/commands/dl.py | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/unshackle/commands/dl.py b/unshackle/commands/dl.py index 17bdd58..62283b8 100644 --- a/unshackle/commands/dl.py +++ b/unshackle/commands/dl.py @@ -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: - 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() + 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.", + ) console.print(Padding(Group(*error_messages), (1, 5))) + console.print_exception() if self.debug_logger: self.debug_logger.log_error(