Skip to content

Commit

Permalink
nit: Better logs for yt-dlp output
Browse files Browse the repository at this point in the history
  • Loading branch information
kinkard committed Sep 8, 2024
1 parent 8ed5a76 commit 80b23c4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/yt_dlp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,11 @@ impl YtDlp {
})
})?;

let yt_dlp_output: YtDlpOutput = serde_json::from_slice(&command.stdout)
.map_err(|e| AudioStreamError::Fail(Box::new(e)))?;
let yt_dlp_output: YtDlpOutput = serde_json::from_slice(&command.stdout).map_err(|e| {
let output = String::from_utf8_lossy(&command.stdout);
warn!("Failed to parse yt-dlp with error: {e}, output: {output}");
AudioStreamError::Fail(Box::new(e))
})?;

Ok(yt_dlp_output)
}
Expand Down

0 comments on commit 80b23c4

Please sign in to comment.