#[non_exhaustive]pub enum ShippingError {
NotFound(Uuid),
CarrierError {
carrier: String,
reason: String,
},
InvalidTrackingNumber(String),
Other(Box<dyn Error + Send + Sync>),
}Expand description
Errors specific to shipping and shipment operations.
§Example
use stateset_core::errors::ShippingError;
let err = ShippingError::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)
Shipment with the given ID was not found.
CarrierError
Carrier rejected the shipment request.
InvalidTrackingNumber(String)
Invalid tracking number format.
Other(Box<dyn Error + Send + Sync>)
Extensibility.
Implementations§
Trait Implementations§
Source§impl Debug for ShippingError
impl Debug for ShippingError
Source§impl Display for ShippingError
impl Display for ShippingError
Source§impl Error for ShippingError
impl Error for ShippingError
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<ShippingError> for CommerceError
impl From<ShippingError> for CommerceError
Source§fn from(source: ShippingError) -> Self
fn from(source: ShippingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ShippingError
impl !UnwindSafe for ShippingError
impl Freeze for ShippingError
impl Send for ShippingError
impl Sync for ShippingError
impl Unpin for ShippingError
impl UnsafeUnpin for ShippingError
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