mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-08 14:00:37 +00:00
improve ffprobe error
This commit is contained in:
parent
30837dbca2
commit
5b91a37318
@ -98,7 +98,11 @@ impl WritingFileAdapter for FFmpegAdapter {
|
|||||||
.await
|
.await
|
||||||
.map_err(spawn_fail)?;
|
.map_err(spawn_fail)?;
|
||||||
if !probe.status.success() {
|
if !probe.status.success() {
|
||||||
return Err(format_err!("ffprobe failed: {:?}", probe.status));
|
return Err(format_err!(
|
||||||
|
"ffprobe failed: {:?}\n{}",
|
||||||
|
probe.status,
|
||||||
|
String::from_utf8_lossy(&probe.stderr)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
let p: FFprobeOutput = serde_json::from_slice(&probe.stdout)?;
|
let p: FFprobeOutput = serde_json::from_slice(&probe.stdout)?;
|
||||||
!p.streams.is_empty()
|
!p.streams.is_empty()
|
||||||
|
@ -198,16 +198,19 @@ pub async fn loop_adapt_inner(
|
|||||||
ai: AdaptInfo,
|
ai: AdaptInfo,
|
||||||
) -> anyhow::Result<AdaptedFilesIterBox> {
|
) -> anyhow::Result<AdaptedFilesIterBox> {
|
||||||
let fph = ai.filepath_hint.clone();
|
let fph = ai.filepath_hint.clone();
|
||||||
let inp = adapter
|
let inp = adapter.adapt(ai, &detection_reason).await;
|
||||||
.adapt(ai, &detection_reason)
|
let inp = if adapter.metadata().name == "postprocprefix" {
|
||||||
.await
|
// don't add confusing error context
|
||||||
.with_context(|| {
|
inp?
|
||||||
|
} else {
|
||||||
|
inp.with_context(|| {
|
||||||
format!(
|
format!(
|
||||||
"adapting {} via {} failed",
|
"adapting {} via {} failed",
|
||||||
fph.to_string_lossy(),
|
fph.to_string_lossy(),
|
||||||
adapter.metadata().name
|
adapter.metadata().name
|
||||||
)
|
)
|
||||||
})?;
|
})?
|
||||||
|
};
|
||||||
let s = stream! {
|
let s = stream! {
|
||||||
for await file in inp {
|
for await file in inp {
|
||||||
match buf_choose_adapter(file?).await? {
|
match buf_choose_adapter(file?).await? {
|
||||||
|
Loading…
Reference in New Issue
Block a user