| 1 | use thiserror::Error; |
| 2 | |
| 3 | /// Errors returned for histogram construction and operations. |
| 4 | #[non_exhaustive] |
| 5 | #[derive(Error, Debug, PartialEq)] |
| 6 | pub enum Error { |
| 7 | #[error("max power is too high, check that n <= 64")] |
| 8 | MaxPowerTooHigh, |
| 9 | #[error("max power is too low, check that grouping_power < max_value_power")] |
| 10 | MaxPowerTooLow, |
| 11 | #[deprecated(note = "Use InvalidQuantile")] |
| 12 | #[error("invalid percentile, must be in range 0.0..=1.0")] |
| 13 | InvalidPercentile, |
| 14 | #[error("invalid quantile, must be in range 0.0..=1.0")] |
| 15 | InvalidQuantile, |
| 16 | #[error("the value is outside of the storable range")] |
| 17 | OutOfRange, |
| 18 | #[error("the histogram parameters are incompatible")] |
| 19 | IncompatibleParameters, |
| 20 | #[error("an overflow occurred")] |
| 21 | Overflow, |
| 22 | #[error("an underflow occurred")] |
| 23 | Underflow, |
| 24 | #[error("the histogram is not a subset")] |
| 25 | InvalidSubset, |
| 26 | } |