1use snafu::Snafu;
2
3pub type Result<T, E = Error> = std::result::Result<T, E>;
4
5#[derive(Debug, Snafu)]
6#[snafu(visibility(pub(super)))]
7pub enum Error {
8 #[snafu(display("Invalid media type: {value}"))]
9 MediaType {
10 value: String,
11 source: mime::FromStrError,
12 },
13 #[snafu(display("Invalid weight: {value}"))]
14 ParseWeight {
15 value: String,
16 source: std::num::ParseFloatError,
17 },
18 #[snafu(display("Weight should be 0.0-1.0. Got {value}"))]
19 WeightRange { value: f32 },
20}