- src/brokers/: pool manager, r_broker (rec.read), w_broker (rec.write), BrokerPayload struct, BrokerError type - src/core/: NamasteCore trait — fetch/write/update/delete interface, stubs - IPL step 6: spawns rBroker + wBroker pools after exchange declaration - tests/broker_pool_test.rs: integration tests for pool spawn (skip if broker down) - BrokerPayload unit tests + doctest in payload.rs - Added futures-lite, serde_json to Cargo.toml - README.md, CLAUDE.md, wiki updated to reflect new structure and status Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
953 B
Rust
34 lines
953 B
Rust
//! # brokers/error.rs — Broker Error Types
|
|
//!
|
|
//! Defines the error type for all broker task operations in BEDS.
|
|
//!
|
|
//! ## Calling Agents
|
|
//! - `brokers::r_broker` — returned from spawn and consume operations
|
|
//! - `brokers::mod` — surfaced from pool management
|
|
//!
|
|
//! **Author:** mks
|
|
//! **Version:** 1.0
|
|
//!
|
|
//! ## History
|
|
//! * `2026-04-05` - mks - original coding
|
|
|
|
/// Errors that can occur in any BEDS broker task.
|
|
///
|
|
/// AMQP protocol errors are wrapped transparently via the `From` impl.
|
|
/// Additional variants cover broker-specific failure modes.
|
|
///
|
|
/// # History
|
|
///
|
|
/// * `2026-04-05` - mks - original coding
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum BrokerError {
|
|
#[error("AMQP protocol error: {0}")]
|
|
Protocol(#[from] lapin::Error),
|
|
|
|
#[error("Broker task '{0}' failed to start: {1}")]
|
|
StartupFailed(String, String),
|
|
|
|
#[error("Message decode error in broker '{0}': {1}")]
|
|
DecodeFailed(String, String),
|
|
}
|