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 = std::result::Result;