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:
@@ -114,7 +114,7 @@ impl Download {
|
||||
matches!(
|
||||
self.status,
|
||||
DownloadStatus::Completed
|
||||
| DownloadStatus::Failed
|
||||
| DownloadStatus::Failed(_)
|
||||
| DownloadStatus::TimedOut
|
||||
)
|
||||
}
|
||||
@@ -159,7 +159,8 @@ pub enum DownloadStatus {
|
||||
total_bytes: u64,
|
||||
},
|
||||
Completed,
|
||||
Failed,
|
||||
/// Failed, optionally with a human-readable reason.
|
||||
Failed(Option<String>),
|
||||
TimedOut,
|
||||
}
|
||||
impl Transfer {
|
||||
|
||||
Reference in New Issue
Block a user