Files
AstrBot/rust/src/error.rs
LIghtJUNction eae35ffd64 refactor: 迁移 Rust 核心代码至 rust/ 目录
- 将 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 等核心模块
2026-03-27 00:15:44 +08:00

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),
}