pub enum OrderError {
NotFound(String),
InvalidProduct(String),
InvalidUser(String),
InsufficientStock(String),
ValidationError(String),
UserService(UserError),
ProductService(ProductError),
DatabaseError(String),
ActorCommunicationError(String),
}Expand description
Errors that can occur during order operations.
This error type is used both by the client (OrderClient) and internally by the Order entity’s lifecycle hooks.
Variants§
NotFound(String)
The requested order was not found.
InvalidProduct(String)
The product specified in the order is invalid or does not exist.
InvalidUser(String)
The user specified in the order is invalid or does not exist.
InsufficientStock(String)
There is insufficient stock to fulfill the order.
ValidationError(String)
The order data provided is invalid.
UserService(UserError)
Error from User service (entity-level)
ProductService(ProductError)
Error from Product service (entity-level)
DatabaseError(String)
An underlying database error occurred.
ActorCommunicationError(String)
An error occurred while communicating with the actor system.
Trait Implementations§
Source§impl Debug for OrderError
impl Debug for OrderError
Source§impl Display for OrderError
impl Display for OrderError
Source§impl Error for OrderError
impl Error for OrderError
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<ProductError> for OrderError
impl From<ProductError> for OrderError
Source§fn from(source: ProductError) -> Self
fn from(source: ProductError) -> Self
Converts to this type from the input type.
Source§impl From<String> for OrderError
impl From<String> for OrderError
Auto Trait Implementations§
impl Freeze for OrderError
impl RefUnwindSafe for OrderError
impl Send for OrderError
impl Sync for OrderError
impl Unpin for OrderError
impl UnwindSafe for OrderError
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