pub enum IcarusError {
Unauthorized(String),
ValidationError {
field: String,
message: String,
},
NotFound(String),
AlreadyExists(String),
StorageError(String),
Other(String),
}Expand description
Standard error type for Icarus operations
Variants§
Authentication or authorization error
ValidationError
Validation error with field and message
NotFound(String)
Resource not found
AlreadyExists(String)
Resource already exists
StorageError(String)
Storage operation failed
Other(String)
Generic error with message
Implementations§
Source§impl IcarusError
impl IcarusError
Create an unauthorized error
Sourcepub fn validation(
field: impl Into<String>,
message: impl Into<String>,
) -> IcarusError
pub fn validation( field: impl Into<String>, message: impl Into<String>, ) -> IcarusError
Create a validation error
Sourcepub fn not_found(resource: impl Into<String>) -> IcarusError
pub fn not_found(resource: impl Into<String>) -> IcarusError
Create a not found error
Sourcepub fn already_exists(resource: impl Into<String>) -> IcarusError
pub fn already_exists(resource: impl Into<String>) -> IcarusError
Create an already exists error
Sourcepub fn storage(message: impl Into<String>) -> IcarusError
pub fn storage(message: impl Into<String>) -> IcarusError
Create a storage error
Trait Implementations§
Source§impl CandidType for IcarusError
impl CandidType for IcarusError
Source§impl Clone for IcarusError
impl Clone for IcarusError
Source§fn clone(&self) -> IcarusError
fn clone(&self) -> IcarusError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IcarusError
impl Debug for IcarusError
Source§impl<'de> Deserialize<'de> for IcarusError
impl<'de> Deserialize<'de> for IcarusError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IcarusError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IcarusError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for IcarusError
impl Display for IcarusError
Source§impl Error for IcarusError
impl Error for IcarusError
1.30.0 · 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<&str> for IcarusError
impl From<&str> for IcarusError
Source§fn from(s: &str) -> IcarusError
fn from(s: &str) -> IcarusError
Converts to this type from the input type.
Source§impl From<String> for IcarusError
impl From<String> for IcarusError
Source§fn from(s: String) -> IcarusError
fn from(s: String) -> IcarusError
Converts to this type from the input type.
Source§impl Serialize for IcarusError
impl Serialize for IcarusError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for IcarusError
impl RefUnwindSafe for IcarusError
impl Send for IcarusError
impl Sync for IcarusError
impl Unpin for IcarusError
impl UnwindSafe for IcarusError
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