basis_points/error.rs
1//! Error types for `basis-points`.
2//!
3//! This module defines [`BasisPointsError`], used when validation fails or when
4//! conversions cannot be performed safely.
5
6use thiserror::Error;
7
8/// Errors returned by `BasisPoints` validation and conversions.
9#[derive(Debug, Error, PartialEq, Eq)]
10pub enum BasisPointsError {
11 /// Basis points must be less than or equal to `10_000`.
12 #[error("Basis points must be less than or equal to 10000")]
13 InvalidBasisPoints,
14 /// Decimal could not be safely cast to the target integer type.
15 #[error("Decimal could not be safely casted to the target type")]
16 ConversionFailed,
17}