fly_accept_encoding/
error.rs

1use std::result;
2
3/// A specialized [`Result`] type for this crate's operations.
4///
5/// This is generally used to avoid writing out [Error] directly and
6/// is otherwise a direct mapping to [`Result`].
7///
8/// [`Result`]: https://doc.rust-lang.org/nightly/std/result/enum.Result.html
9/// [`Error`]: std.struct.Error.html
10pub type Result<T> = result::Result<T, Error>;
11
12/// A list enumerating the categories of errors in this crate.
13///
14/// This list is intended to grow over time and it is not recommended to
15/// exhaustively match against it.
16///
17/// It is used with the [`Error`] struct.
18///
19/// [`Error`]: std.struct.Error.html
20#[derive(Debug, thiserror::Error)]
21pub enum Error {
22    /// Invalid header encoding.
23    #[error("Invalid header encoding.")]
24    InvalidEncoding,
25    /// The encoding scheme is unknown.
26    #[error("Unknown encoding scheme.")]
27    UnknownEncoding,
28    /// Any error not part of this list.
29    #[error("Generic error.")]
30    Other,
31}