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
Sourcepub fn operation_failed(
component_type: impl Into<String>,
component_id: impl Into<String>,
operation: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn operation_failed( component_type: impl Into<String>, component_id: impl Into<String>, operation: impl Into<String>, reason: impl Into<String>, ) -> Self
Sourcepub fn provisioning(msg: impl Into<String>) -> Self
pub fn provisioning(msg: impl Into<String>) -> Self
Create a provisioning error.
§Deprecated
Consider using operation_failed with specific component context instead.
Sourcepub fn component_error(msg: impl Into<String>) -> Self
pub fn component_error(msg: impl Into<String>) -> Self
Create a component error (generic operation failure).
§Deprecated
Consider using operation_failed with specific component context instead.