refactor(ml): remove stub ErrorCategory, use common::error::ErrorCategory

The ml crate had a stub ErrorCategory with only 1 variant (System).
Replace it with a re-export of the canonical 24-variant ErrorCategory
from common::error. Also rename the unused ErrorCategory in
data/src/providers/common.rs to ProviderErrorCategory to avoid
name collision.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-02-22 21:14:04 +01:00
parent d2e6a78bab
commit 36a560ccb3
2 changed files with 6 additions and 13 deletions

View File

@@ -47,14 +47,14 @@ use serde::{Deserialize, Serialize};
/// # Examples
///
/// ```rust
/// use data::providers::common::ErrorCategory;
/// use data::providers::common::ProviderErrorCategory;
///
/// match error_category {
/// ErrorCategory::RateLimit => {
/// ProviderErrorCategory::RateLimit => {
/// // Implement exponential backoff
/// tokio::time::sleep(Duration::from_millis(1000)).await;
/// },
/// ErrorCategory::Authentication => {
/// ProviderErrorCategory::Authentication => {
/// // Refresh credentials and reconnect
/// provider.refresh_auth().await?;
/// },
@@ -64,7 +64,7 @@ use serde::{Deserialize, Serialize};
/// }
/// ```
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ErrorCategory {
pub enum ProviderErrorCategory {
/// Network connectivity issues, WebSocket disconnections
///
/// Indicates problems with the underlying network connection to the

View File

@@ -457,15 +457,8 @@ impl CommonError {
}
}
/// Error categories for system-wide error classification
///
/// This enum provides a way to categorize errors across the entire system,
/// enabling better error handling, logging, and monitoring strategies.
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum ErrorCategory {
/// System-level errors including hardware, network, and infrastructure issues
System,
}
// Re-export canonical ErrorCategory from common crate (24 variants)
pub use ::common::error::ErrorCategory;
// Now using real types from common crate