pub enum DrasiError {
ComponentNotFound {
component_type: String,
component_id: String,
},
AlreadyExists {
component_type: String,
component_id: String,
},
InvalidConfig {
message: String,
},
InvalidState {
message: String,
},
Validation {
message: String,
},
OperationFailed {
component_type: String,
component_id: String,
operation: String,
reason: String,
},
Internal(Error),
}Expand description
Main error type for drasi-lib operations.
This enum provides structured error variants that enable type-safe pattern matching by callers. Each variant contains contextual information about the error.
Variants§
ComponentNotFound
Component (source, query, or reaction) was not found.
Fields
AlreadyExists
Component already exists with the given ID.
InvalidConfig
Invalid configuration provided.
InvalidState
Operation is not valid in the current state.
Validation
Validation failed (e.g., builder validation, input validation).
OperationFailed
A component operation (start, stop, delete, etc.) failed.
Fields
Internal(Error)
Internal error - wraps underlying errors while preserving the error chain.
Use .source() to access the underlying error chain.
Implementations§
Source§impl DrasiError
impl DrasiError
Sourcepub fn component_not_found(
component_type: impl Into<String>,
component_id: impl Into<String>,
) -> Self
pub fn component_not_found( component_type: impl Into<String>, component_id: impl Into<String>, ) -> Self
Sourcepub fn already_exists(
component_type: impl Into<String>,
component_id: impl Into<String>,
) -> Self
pub fn already_exists( component_type: impl Into<String>, component_id: impl Into<String>, ) -> Self
Sourcepub fn invalid_config(message: impl Into<String>) -> Self
pub fn invalid_config(message: impl Into<String>) -> Self
Sourcepub fn invalid_state(message: impl Into<String>) -> Self
pub fn invalid_state(message: impl Into<String>) -> Self
Sourcepub fn validation(message: impl Into<String>) -> Self
pub fn validation(message: impl Into<String>) -> Self
Trait Implementations§
Source§impl Debug for DrasiError
impl Debug for DrasiError
Source§impl Display for DrasiError
impl Display for DrasiError
Source§impl Error for DrasiError
impl Error for DrasiError
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 DrasiError
impl RefUnwindSafe for DrasiError
impl Send for DrasiError
impl Sync for DrasiError
impl Unpin for DrasiError
impl UnsafeUnpin for DrasiError
impl UnwindSafe for DrasiError
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