pub enum OatsError {
ObjectNotFound {
id: String,
},
TraitNotFound {
trait_name: String,
},
ActionFailed {
message: String,
},
SystemError {
message: String,
},
InvalidState {
message: String,
},
ValidationError {
message: String,
},
ResourceExhausted {
message: String,
},
TimeoutError {
message: String,
},
SerializationError(Error),
IoError(Error),
Unknown {
message: String,
},
}Expand description
Error types for OATS operations
Variants§
ObjectNotFound
TraitNotFound
ActionFailed
SystemError
InvalidState
ValidationError
ResourceExhausted
TimeoutError
SerializationError(Error)
IoError(Error)
Unknown
Implementations§
Source§impl OatsError
impl OatsError
Sourcepub fn object_not_found(id: impl Into<String>) -> Self
pub fn object_not_found(id: impl Into<String>) -> Self
Create a new object not found error
Sourcepub fn trait_not_found(trait_name: impl Into<String>) -> Self
pub fn trait_not_found(trait_name: impl Into<String>) -> Self
Create a new trait not found error
Sourcepub fn action_failed(message: impl Into<String>) -> Self
pub fn action_failed(message: impl Into<String>) -> Self
Create a new action failed error
Sourcepub fn system_error(message: impl Into<String>) -> Self
pub fn system_error(message: impl Into<String>) -> Self
Create a new system error
Sourcepub fn invalid_state(message: impl Into<String>) -> Self
pub fn invalid_state(message: impl Into<String>) -> Self
Create a new invalid state error
Sourcepub fn validation_error(message: impl Into<String>) -> Self
pub fn validation_error(message: impl Into<String>) -> Self
Create a new validation error
Sourcepub fn resource_exhausted(message: impl Into<String>) -> Self
pub fn resource_exhausted(message: impl Into<String>) -> Self
Create a new resource exhausted error
Sourcepub fn timeout_error(message: impl Into<String>) -> Self
pub fn timeout_error(message: impl Into<String>) -> Self
Create a new timeout error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable
Trait Implementations§
Source§impl Error for OatsError
impl Error for OatsError
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()
Auto Trait Implementations§
impl Freeze for OatsError
impl !RefUnwindSafe for OatsError
impl Send for OatsError
impl Sync for OatsError
impl Unpin for OatsError
impl !UnwindSafe for OatsError
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