lofty-rs/src/error.rs
Serial f956dfd3e2 Working (rough) implementation of write_to for ogg
ogg can now successfully be read from and written to. This breaks all other tests currently.

Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
2021-04-13 23:29:13 -04:00

36 lines
1,020 B
Rust

/// Errors that could occur within Lofty.
#[derive(thiserror::Error, Debug)]
pub enum Error {
/// Unknown file extension.
#[error("Failed to guess the metadata format based on the file extension.")]
UnknownFileExtension(String),
/// Unsupported file extension
#[error("Unsupported format: {0}")]
UnsupportedFormat(String),
#[error("Unsupported mime type: {0}")]
UnsupportedMimeType(String),
#[error(transparent)]
FlacTagError(#[from] metaflac::Error),
#[error(transparent)]
Id3TagError(#[from] id3::Error),
#[error(transparent)]
Mp4TagError(#[from] mp4ameta::Error),
#[error(transparent)]
OpusTagError(#[from] opus_headers::ParseError),
#[error(transparent)]
LewtonError(#[from] lewton::VorbisError),
#[error(transparent)]
OggError(#[from] ogg::OggReadError),
#[error("")]
NotAPicture,
/// Represents all cases of `std::io::Error`.
#[error(transparent)]
IOError(#[from] std::io::Error),
}
/// Type alias for the result of tag operations.
pub type Result<T> = std::result::Result<T, Error>;