Skip to main content

uz_types/
error.rs

1/// Barcha tip xatolarini birlashtiruvchi aggregate error.
2///
3/// Har bir `parse()` **o'zining aniq** xatosini qaytaradi (`PassportError`, ...);
4/// `TypeError` — `?` orqali avtomatik (`#[from]`) yig'iladigan umumiy tur.
5#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
6#[non_exhaustive]
7pub enum TypeError {
8    /// Pasport.
9    #[error(transparent)]
10    Passport(#[from] crate::PassportError),
11    /// PINFL.
12    #[error(transparent)]
13    Pinfl(#[from] crate::PinflError),
14    /// Telefon raqami.
15    #[error(transparent)]
16    PhoneNumber(#[from] crate::PhoneNumberError),
17    /// Email.
18    #[error(transparent)]
19    EmailAddress(#[from] crate::EmailAddressError),
20    /// Tug'ilgan sana (feature = "date").
21    #[cfg(feature = "date")]
22    #[error(transparent)]
23    BirthDate(#[from] crate::BirthDateError),
24    /// ID tiplari (feature = "id").
25    #[cfg(feature = "id")]
26    #[error(transparent)]
27    Id(#[from] crate::IdError),
28    /// Token / sir tiplari.
29    #[error(transparent)]
30    Token(#[from] crate::TokenError),
31}