This commit is contained in:
houseme
2025-06-09 12:25:56 +08:00
parent 152ad57c1d
commit 28c71cc351
12 changed files with 23 additions and 315 deletions
-17
View File
@@ -1,4 +1,3 @@
use config::ConfigError;
use thiserror::Error;
use tokio::sync::mpsc::error;
use tokio::task::JoinError;
@@ -35,8 +34,6 @@ pub enum Error {
Custom(String),
#[error("Configuration error: {0}")]
ConfigError(String),
#[error("Configuration loading error: {0}")]
Config(#[from] ConfigError),
#[error("create adapter failed error: {0}")]
AdapterCreationFailed(String),
}
@@ -150,20 +147,6 @@ mod tests {
}
}
#[test]
fn test_config_error_conversion() {
// Test configuration error conversion
let config_error = ConfigError::Message("invalid configuration".to_string());
let converted_error: Error = config_error.into();
match converted_error {
Error::Config(_) => {
assert!(converted_error.to_string().contains("Configuration loading error"));
}
_ => panic!("Expected Config error variant"),
}
}
#[tokio::test]
async fn test_channel_send_error_conversion() {
// Test channel send error conversion