mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-05-16 21:59:26 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user