#[non_exhaustive]pub enum DbError {
Show 21 variants
ConnectionFailed {
endpoint: String,
reason: String,
},
BufferFull {
size: u32,
buffer_name: String,
},
BufferLagged {
lag_count: u64,
buffer_name: String,
},
BufferClosed {
buffer_name: String,
},
BufferEmpty,
RecordNotFound {
record_name: String,
},
RecordKeyNotFound {
key: String,
},
InvalidRecordId {
id: u32,
},
TypeMismatch {
record_id: u32,
expected_type: String,
},
InvalidOperation {
operation: String,
reason: String,
},
PermissionDenied {
operation: String,
},
MissingConfiguration {
parameter: String,
},
InvalidConfiguration {
errors: Vec<ConfigError>,
},
RuntimeError {
message: String,
},
Internal {
code: u32,
message: String,
},
CyclicDependency {
records: Vec<String>,
},
TransformInputNotFound {
output_key: String,
input_key: String,
},
Io {
source: Error,
},
IoWithContext {
context: String,
source: Error,
},
Json {
source: Error,
},
JsonWithContext {
context: String,
source: Error,
},
}Expand description
Streamlined error type for AimDB operations
Only includes errors that are actually used in the codebase, removing theoretical/unused error variants for simplicity.
#[non_exhaustive]: match on DbError::kind where you only need to know
what to do about the failure.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ConnectionFailed
Connection or timeout failures
BufferFull
Buffer is full and cannot accept more items
BufferLagged
Consumer lagged behind producer (SPMC ring buffers)
BufferClosed
Buffer channel has been closed (shutdown)
BufferEmpty
Non-blocking receive found no pending values
RecordNotFound
Record type not found in database (legacy, by type name)
RecordKeyNotFound
Record key not found in registry
InvalidRecordId
RecordId out of bounds or invalid
TypeMismatch
Type mismatch when accessing record by ID
InvalidOperation
Invalid operation attempted
PermissionDenied
Permission denied for operation
MissingConfiguration
Missing required configuration parameter
InvalidConfiguration
Configuration mistakes collected by AimDbBuilder::build() — one
entry per finding, so a single run surfaces every mistake.
Fields
errors: Vec<ConfigError>RuntimeError
Runtime execution error (task spawning, scheduling, etc.)
Internal
Internal error for unexpected conditions
CyclicDependency
Transform dependency graph contains a cycle
TransformInputNotFound
Transform input key references a record that was not registered
Io
I/O operation error
IoWithContext
I/O operation error with context
Json
JSON serialization error
JsonWithContext
JSON serialization error with context
Implementations§
Source§impl DbError
impl DbError
Sourcepub fn runtime_error(message: impl Into<String>) -> Self
pub fn runtime_error(message: impl Into<String>) -> Self
Builds a RuntimeError.
Sourcepub fn permission_denied(operation: impl Into<String>) -> Self
pub fn permission_denied(operation: impl Into<String>) -> Self
Builds a PermissionDenied.
Sourcepub fn record_key_not_found(key: impl Into<String>) -> Self
pub fn record_key_not_found(key: impl Into<String>) -> Self
Builds a RecordKeyNotFound.
Sourcepub fn missing_configuration(parameter: impl Into<String>) -> Self
pub fn missing_configuration(parameter: impl Into<String>) -> Self
Builds a MissingConfiguration.
Trait Implementations§
Source§impl Error for DbError
impl Error for DbError
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<DbError> for RemoteError
impl From<DbError> for RemoteError
Source§impl From<ExecutorError> for DbError
Convert executor errors to database errors
impl From<ExecutorError> for DbError
Convert executor errors to database errors
This allows engine plumbing to return ExecutorError while the core
database works with DbError for consistency across the API.