pub enum Error {
Show 17 variants
Discovery {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
SquadFormation {
message: String,
squad_id: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
HierarchicalOp {
message: String,
operation: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Composition {
message: String,
capability: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Storage {
message: String,
operation: Option<String>,
key: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Network {
message: String,
peer_id: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Serialization(Error),
InvalidTransition {
from: String,
to: String,
reason: String,
},
NotFound {
resource_type: String,
id: String,
},
Configuration {
message: String,
config_key: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Timeout {
operation: String,
duration_ms: u64,
},
Ditto {
message: String,
operation: Option<String>,
source: Option<Box<dyn Error + Send + Sync>>,
},
Internal(String),
InvalidInput(String),
ConflictDetected(String),
Security(String),
EventOp {
message: String,
operation: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
}Expand description
Errors that can occur in the Peat protocol
Variants§
Discovery
Discovery phase errors
SquadFormation
Cell formation errors
HierarchicalOp
Hierarchical operation errors
Composition
Capability composition errors
Storage
CRDT/Storage errors
Fields
Network
Network errors
Serialization(Error)
Serialization/deserialization errors
InvalidTransition
Invalid state transition
NotFound
Resource not found
Configuration
Configuration errors
Timeout
Timeout errors
Ditto
Ditto-specific errors
Internal(String)
Generic internal error
InvalidInput(String)
Invalid input provided
ConflictDetected(String)
Command conflict detected
Security(String)
Security/Authentication errors
EventOp
Event operation errors (ADR-027)
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable
Sourcepub fn severity(&self) -> ErrorSeverity
pub fn severity(&self) -> ErrorSeverity
Get error severity level
Sourcepub fn context(&self) -> ErrorContext
pub fn context(&self) -> ErrorContext
Get context information from the error
Source§impl Error
Helper functions for creating common errors
impl Error
Helper functions for creating common errors
Sourcepub fn storage_error(
message: impl Into<String>,
operation: impl Into<String>,
key: Option<String>,
) -> Self
pub fn storage_error( message: impl Into<String>, operation: impl Into<String>, key: Option<String>, ) -> Self
Create a storage error with context
Sourcepub fn network_error(
message: impl Into<String>,
peer_id: Option<String>,
) -> Self
pub fn network_error( message: impl Into<String>, peer_id: Option<String>, ) -> Self
Create a network error with context
Sourcepub fn timeout_error(operation: impl Into<String>, duration_ms: u64) -> Self
pub fn timeout_error(operation: impl Into<String>, duration_ms: u64) -> Self
Create a timeout error with context
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<SecurityError> for Error
impl From<SecurityError> for Error
Source§fn from(err: SecurityError) -> Self
fn from(err: SecurityError) -> Self
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.