pub enum BotError {
CollectorError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
StrategyError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
ExecutorError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
ChannelError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
Other(Error),
}
Expand description
Represents all possible errors that can occur in the bot engine.
This enum provides structured error types for different components of the system:
- Collector errors (event source issues)
- Strategy errors (event processing issues)
- Executor errors (action execution issues)
- Channel errors (communication issues)
Variants§
CollectorError
An error that occurred in a collector component.
Fields
StrategyError
An error that occurred in a strategy component.
Fields
ExecutorError
An error that occurred in an executor component.
Fields
ChannelError
An error that occurred in the channel communication system.
Fields
Other(Error)
A catch-all variant for errors that don’t fit into other categories.
Implementations§
Source§impl BotError
impl BotError
Sourcepub fn collector_error(message: impl Into<String>) -> Self
pub fn collector_error(message: impl Into<String>) -> Self
Creates a new collector error with just a message.
§Arguments
message
- A description of what went wrong
Sourcepub fn collector_error_with_source(
message: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn collector_error_with_source( message: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Creates a new collector error with both a message and an underlying cause.
§Arguments
message
- A description of what went wrongsource
- The underlying error that caused this failure
Sourcepub fn strategy_error(message: impl Into<String>) -> Self
pub fn strategy_error(message: impl Into<String>) -> Self
Creates a new strategy error with just a message.
§Arguments
message
- A description of what went wrong
Sourcepub fn strategy_error_with_source(
message: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn strategy_error_with_source( message: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Creates a new strategy error with both a message and an underlying cause.
§Arguments
message
- A description of what went wrongsource
- The underlying error that caused this failure
Sourcepub fn executor_error(message: impl Into<String>) -> Self
pub fn executor_error(message: impl Into<String>) -> Self
Creates a new executor error with just a message.
§Arguments
message
- A description of what went wrong
Sourcepub fn executor_error_with_source(
message: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn executor_error_with_source( message: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Creates a new executor error with both a message and an underlying cause.
§Arguments
message
- A description of what went wrongsource
- The underlying error that caused this failure
Sourcepub fn channel_error(message: impl Into<String>) -> Self
pub fn channel_error(message: impl Into<String>) -> Self
Creates a new channel error with just a message.
§Arguments
message
- A description of what went wrong
Sourcepub fn channel_error_with_source(
message: impl Into<String>,
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> Self
pub fn channel_error_with_source( message: impl Into<String>, source: impl Into<Box<dyn Error + Send + Sync>>, ) -> Self
Creates a new channel error with both a message and an underlying cause.
§Arguments
message
- A description of what went wrongsource
- The underlying error that caused this failure