mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-20 11:32:19 +00:00
chore(heal): remove seven dead error variants
heal::Error carried six variants with zero construction and zero match sites (ConfigurationError, NotFound, TaskAlreadyExists, ManagerNotRunning, EventProcessingFailed, ProgressTrackingFailed) plus IO(String), which was never constructed either — its only appearances were two or-pattern match arms that could never fire (task.rs's demotion match and the recoverability classifier). All seven are deleted and the two or-patterns lose their dead alternative. Config(String) stays (live, four construction sites); Io(std::io::Error) stays; the retry classifier's behavior is untouched per the issue constraint — removing an arm that can never match is not a classification change. Ref rustfs/backlog#1831 (PR3).
This commit is contained in:
@@ -34,36 +34,21 @@ pub enum Error {
|
|||||||
#[error("Configuration error: {0}")]
|
#[error("Configuration error: {0}")]
|
||||||
Config(String),
|
Config(String),
|
||||||
|
|
||||||
#[error("Heal configuration error: {message}")]
|
|
||||||
ConfigurationError { message: String },
|
|
||||||
|
|
||||||
#[error("Other error: {0}")]
|
#[error("Other error: {0}")]
|
||||||
Other(String),
|
Other(String),
|
||||||
|
|
||||||
#[error("Serialization error: {0}")]
|
#[error("Serialization error: {0}")]
|
||||||
Serialization(String),
|
Serialization(String),
|
||||||
|
|
||||||
#[error("IO error: {0}")]
|
|
||||||
IO(String),
|
|
||||||
|
|
||||||
#[error("Not found: {0}")]
|
|
||||||
NotFound(String),
|
|
||||||
|
|
||||||
#[error("Invalid checkpoint: {0}")]
|
#[error("Invalid checkpoint: {0}")]
|
||||||
InvalidCheckpoint(String),
|
InvalidCheckpoint(String),
|
||||||
|
|
||||||
#[error("Heal task not found: {task_id}")]
|
#[error("Heal task not found: {task_id}")]
|
||||||
TaskNotFound { task_id: String },
|
TaskNotFound { task_id: String },
|
||||||
|
|
||||||
#[error("Heal task already exists: {task_id}")]
|
|
||||||
TaskAlreadyExists { task_id: String },
|
|
||||||
|
|
||||||
#[error("Invalid heal client token")]
|
#[error("Invalid heal client token")]
|
||||||
InvalidClientToken,
|
InvalidClientToken,
|
||||||
|
|
||||||
#[error("Heal manager is not running")]
|
|
||||||
ManagerNotRunning,
|
|
||||||
|
|
||||||
#[error("Heal task execution failed: {message}")]
|
#[error("Heal task execution failed: {message}")]
|
||||||
TaskExecutionFailed { message: String },
|
TaskExecutionFailed { message: String },
|
||||||
|
|
||||||
@@ -78,12 +63,6 @@ pub enum Error {
|
|||||||
|
|
||||||
#[error("Heal task timeout")]
|
#[error("Heal task timeout")]
|
||||||
TaskTimeout,
|
TaskTimeout,
|
||||||
|
|
||||||
#[error("Heal event processing failed: {message}")]
|
|
||||||
EventProcessingFailed { message: String },
|
|
||||||
|
|
||||||
#[error("Heal progress tracking failed: {message}")]
|
|
||||||
ProgressTrackingFailed { message: String },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A specialized Result type for heal operations
|
/// A specialized Result type for heal operations
|
||||||
@@ -129,9 +108,7 @@ impl Error {
|
|||||||
| DiskError::FaultyDisk
|
| DiskError::FaultyDisk
|
||||||
) || is_recoverable_heal_error_message(&err.to_string())
|
) || is_recoverable_heal_error_message(&err.to_string())
|
||||||
}
|
}
|
||||||
Error::TaskExecutionFailed { message } | Error::IO(message) | Error::Other(message) => {
|
Error::TaskExecutionFailed { message } | Error::Other(message) => is_recoverable_heal_error_message(message),
|
||||||
is_recoverable_heal_error_message(message)
|
|
||||||
}
|
|
||||||
Error::Io(err) => is_recoverable_heal_error_message(&err.to_string()),
|
Error::Io(err) => is_recoverable_heal_error_message(&err.to_string()),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ impl HealTask {
|
|||||||
| EcstoreError::ObjectNotFound(_, _)
|
| EcstoreError::ObjectNotFound(_, _)
|
||||||
| EcstoreError::VersionNotFound(_, _, _),
|
| EcstoreError::VersionNotFound(_, _, _),
|
||||||
) => true,
|
) => true,
|
||||||
Error::Other(message) | Error::IO(message) => {
|
Error::Other(message) => {
|
||||||
message.contains("File not found")
|
message.contains("File not found")
|
||||||
|| message.contains("file not found")
|
|| message.contains("file not found")
|
||||||
|| message.contains("File version not found")
|
|| message.contains("File version not found")
|
||||||
|
|||||||
Reference in New Issue
Block a user