#[non_exhaustive]pub enum CustomerError {
NotFound(Uuid),
EmailAlreadyExists(String),
NotActive,
Other(Box<dyn Error + Send + Sync>),
}Expand description
Errors specific to customer operations.
§Example
use stateset_core::errors::CustomerError;
let err = CustomerError::not_found(uuid::Uuid::nil());
assert!(err.to_string().contains("not found"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
NotFound(Uuid)
Customer with the given ID was not found.
EmailAlreadyExists(String)
Email address is already registered.
NotActive
Customer account is not active.
Other(Box<dyn Error + Send + Sync>)
Extensibility.
Implementations§
Source§impl CustomerError
impl CustomerError
Trait Implementations§
Source§impl Debug for CustomerError
impl Debug for CustomerError
Source§impl Display for CustomerError
impl Display for CustomerError
Source§impl Error for CustomerError
impl Error for CustomerError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<CustomerError> for CommerceError
impl From<CustomerError> for CommerceError
Source§fn from(source: CustomerError) -> Self
fn from(source: CustomerError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for CustomerError
impl !UnwindSafe for CustomerError
impl Freeze for CustomerError
impl Send for CustomerError
impl Sync for CustomerError
impl Unpin for CustomerError
impl UnsafeUnpin for CustomerError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more