Better error reporting when ffprobe fails.

This commit is contained in:
Bill Thiede 2021-02-24 15:26:21 -08:00
parent 872c1096a6
commit 4ba8e3e3ee

View File

@ -297,7 +297,7 @@ fn json_metadata_for_path<P: AsRef<Path> + AsRef<OsStr>>(path: P) -> Result<Stri
]) ])
.arg(Path::new("./").join(path)); .arg(Path::new("./").join(path));
info!(target: "json", "cmd {:?}", cmd); info!(target: "json", "cmd {:?}", cmd);
let output = cmd.output()?; let output = cmd.output().context(format!("failed to run {:?}", cmd))?;
if output.status.success() { if output.status.success() {
return Ok(String::from_utf8(output.stdout)?); return Ok(String::from_utf8(output.stdout)?);
} }
@ -617,7 +617,7 @@ impl MovieLibrary {
Some((path.to_string_lossy().into_owned(), json)) Some((path.to_string_lossy().into_owned(), json))
} }
Err(e) => { Err(e) => {
error!("failed to open {}: {}", path.to_string_lossy(), e); error!("Failed to open {}: {}", path.to_string_lossy(), e);
None None
} }
} }