don't use a string error on ffprobe handler, pass the proper error

This commit is contained in:
chaos 2023-11-08 15:25:13 +00:00
parent f10506be0b
commit abe16ae53b
No known key found for this signature in database
3 changed files with 4 additions and 4 deletions

View file

@ -7,6 +7,8 @@ pub enum AnalyzeError {
ParseError(serde_json::Error),
}
impl std::error::Error for AnalyzeError {}
impl fmt::Display for AnalyzeError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {

View file

@ -3,8 +3,6 @@ use std::{
process::Command,
};
use string_error::into_err;
use crate::{
meta,
types::{AudioFileInfo, Tags},
@ -41,7 +39,7 @@ impl GenericFFMpegAudioFormat {
let output = ffprobe::analyze(&self.path, Some(meta::FFPROBE));
if let Err(err) = output {
return Err(into_err(format!("{}", err)));
return Err(Box::from(err));
}
let output = output.unwrap();

View file

@ -5,4 +5,4 @@ pub mod formats;
mod music_scanner;
pub use formats::is_supported_file;
pub use music_scanner::scan_for_music;
pub use music_scanner::scan_for_music;