Fundamental_Analysis/services/tushare-provider-service/src/error.rs
Lv, Qi 5327e76aaa chore: 提交本轮 Rust 架构迁移相关改动
- docker-compose: 下线 Python backend/config-service,切换至 config-service-rs
- archive: 归档 legacy Python 目录至 archive/python/*
- services: 新增/更新 common-contracts、api-gateway、各 provider、report-generator-service、config-service-rs
- data-persistence-service: API/system 模块与模型/DTO 调整
- frontend: 更新 useApi 与 API 路由
- docs: 更新路线图并勾选光荣退役
- cleanup: 移除 data-distance-service 占位测试
2025-11-16 20:55:46 +08:00

28 lines
708 B
Rust

use thiserror::Error;
#[derive(Error, Debug)]
pub enum ProviderError {
#[error("API request failed: {0}")]
ApiRequest(#[from] reqwest::Error),
#[error("Failed to parse JSON response: {0}")]
JsonParsing(#[from] serde_json::Error),
#[error("Tushare API returned an error: code={code}, message='{msg}'")]
TushareApi { code: i64, msg: String },
#[error("Configuration error: {0}")]
Configuration(String),
#[error("Data mapping error: {0}")]
Mapping(String),
#[error("Persistence client error: {0}")]
Persistence(String),
#[error("Internal error: {0}")]
Internal(#[from] anyhow::Error),
}
pub type Result<T> = std::result::Result<T, ProviderError>;