feat(tui): surface the failure reason on failed downloads
Carry a human-readable reason on DownloadStatus::Failed so it flows through the existing status channel to the TUI. The download Info pane now shows an Error line for a failed download (connect failure, peer disconnect, truncated transfer, peer-reported upload failure, or the underlying transfer error). Failures without a known reason render as before.
This commit is contained in:
@@ -231,7 +231,7 @@ impl MultiDownloadProgress {
|
||||
DownloadStatus::InProgress { .. } => "⧗",
|
||||
DownloadStatus::Paused { .. } => "⏸",
|
||||
DownloadStatus::Completed => "✓",
|
||||
DownloadStatus::Failed => "✗",
|
||||
DownloadStatus::Failed(_) => "✗",
|
||||
DownloadStatus::TimedOut => "⏱",
|
||||
};
|
||||
|
||||
@@ -272,7 +272,7 @@ impl MultiDownloadProgress {
|
||||
DownloadStatus::InProgress { .. } => warning_style(),
|
||||
DownloadStatus::Paused { .. } => info_style(),
|
||||
DownloadStatus::Completed => primary_style(),
|
||||
DownloadStatus::Failed | DownloadStatus::TimedOut => {
|
||||
DownloadStatus::Failed(_) | DownloadStatus::TimedOut => {
|
||||
error_style()
|
||||
}
|
||||
};
|
||||
@@ -346,7 +346,7 @@ pub fn render_download_stats(
|
||||
.filter(|d| {
|
||||
matches!(
|
||||
d.download.status,
|
||||
DownloadStatus::Failed | DownloadStatus::TimedOut
|
||||
DownloadStatus::Failed(_) | DownloadStatus::TimedOut
|
||||
)
|
||||
})
|
||||
.count();
|
||||
|
||||
Reference in New Issue
Block a user