mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
- 将 Rust 核心从 astrbot/rust/ 迁移至 rust/ - 新增 a2a.rs: Agent-to-Agent 通信协议 - 新增 abp.rs: ABP 插件协议客户端 - 新增 server.rs: WebSocket/HTTP 服务器 - 更新 Cargo.toml 依赖 (futures-util) - 重构 config.rs, orchestrator.rs, protocol.rs 等核心模块
31 lines
597 B
Rust
31 lines
597 B
Rust
//! Error types for AstrBot Core
|
|
|
|
use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum AstrBotError {
|
|
#[error("Not connected: {0}")]
|
|
NotConnected(String),
|
|
|
|
#[error("Connection failed: {0}")]
|
|
ConnectionFailed(String),
|
|
|
|
#[error("Protocol error: {0}")]
|
|
Protocol(String),
|
|
|
|
#[error("Timeout: {0}")]
|
|
Timeout(String),
|
|
|
|
#[error("Invalid state: {0}")]
|
|
InvalidState(String),
|
|
|
|
#[error("Not found: {0}")]
|
|
NotFound(String),
|
|
|
|
#[error("IO error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
#[error("JSON error: {0}")]
|
|
Json(#[from] serde_json::Error),
|
|
}
|