Source code for aeat.domain.currency._errors

"""Domain error hierarchy for currency normalization and exchange-rate lookup.

All exceptions extend :class:`~aeat.core.errors.AeatError` so callers can
catch either the domain-specific type or the project-wide base class.
"""

from ...core.errors import AeatError


[docs] class CurrencyError(AeatError): """Base exception for currency normalization."""
[docs] class MissingExchangeRateError(CurrencyError): """Raised when an exchange rate is missing for a given date/currency."""
[docs] class UnsupportedCurrencyError(CurrencyError): """Raised when an unknown currency code is encountered."""
[docs] class ExchangeRateProviderError(CurrencyError): """Raised when an upstream exchange-rate adapter fails to respond."""
[docs] class StaleExchangeRateError(CurrencyError): """Raised when the only available rate is outside the acceptable freshness window."""