Input: Json parsing errors now contain the parsed text (#31)
This commit is contained in:
@@ -16,7 +16,12 @@ pub enum Error {
|
||||
/// An error occurred while reading, or opening a file.
|
||||
Io(IoError),
|
||||
/// An error occurred while parsing JSON (i.e., during metadata/stereo detection).
|
||||
Json(JsonError),
|
||||
Json {
|
||||
/// Json error
|
||||
error: JsonError,
|
||||
/// Text that failed to be parsed
|
||||
parsed_text: String,
|
||||
},
|
||||
/// An error occurred within the Opus codec.
|
||||
Opus(OpusError),
|
||||
/// Failed to extract metadata from alternate pipe.
|
||||
@@ -57,12 +62,6 @@ impl From<IoError> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<JsonError> for Error {
|
||||
fn from(e: JsonError) -> Self {
|
||||
Error::Json(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<OpusError> for Error {
|
||||
fn from(e: OpusError) -> Error {
|
||||
Error::Opus(e)
|
||||
|
||||
Reference in New Issue
Block a user