feat(arr): add Error::Decode for bad subtitle bytes
This commit is contained in:
@@ -74,6 +74,19 @@ pub enum Error {
|
||||
#[source]
|
||||
source: std::io::Error,
|
||||
},
|
||||
|
||||
/// A downloaded subtitle's bytes did not decode under any plausible
|
||||
/// encoding.
|
||||
///
|
||||
/// Writing mojibake into the library is worse than a failed attempt
|
||||
/// (#186 already records a failure reason).
|
||||
#[error("{candidate} did not decode to UTF-8: {detail}")]
|
||||
Decode {
|
||||
/// The candidate whose bytes failed to decode.
|
||||
candidate: CandidateId,
|
||||
/// What was wrong, short enough to log.
|
||||
detail: String,
|
||||
},
|
||||
}
|
||||
|
||||
impl Error {
|
||||
|
||||
Reference in New Issue
Block a user