pub enum PricingError {
RateCalculationFailed(CurrencyConverterError),
InvalidMarkupCalculation(String),
AdjustmentFailed(CurrencyConverterError),
}Expand description
Represents possible errors that can occur specifically during pricing calculations
within the PricingDetail and related modules.
This enum wraps more granular errors (like CurrencyConverterError)
to provide context on where in the pricing pipeline the error occurred.
Variants§
RateCalculationFailed(CurrencyConverterError)
An error indicating that a currency rate calculation failed.
This variant wraps a CurrencyConverterError, providing more context
that the conversion failure happened specifically during the initial
rate calculation phase (e.g., when determining buy_currency_rate
or sell_currency_rate).
InvalidMarkupCalculation(String)
An error indicating that a markup calculation resulted in an invalid state.
This typically occurs when markup parameters are logically impossible
or lead to undefined financial results (e.g., a commission percentage
of 100% or more, which would cause infinite price calculation).
The contained String provides a detailed error message.
AdjustmentFailed(CurrencyConverterError)
An error indicating that an adjustment (like tax, discount, or fixed fee) failed during its application to the price.
This variant wraps a CurrencyConverterError, suggesting that the
adjustment failure was due to an underlying currency conversion issue
(e.g., converting a fixed adjustment amount from one currency to another).
Trait Implementations§
Source§impl Debug for PricingError
impl Debug for PricingError
Source§impl Display for PricingError
impl Display for PricingError
Source§impl Error for PricingError
impl Error for PricingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()