better error

This commit is contained in:
Alexey Shekhirin
2025-11-10 17:25:44 +00:00
parent 6c484b0dda
commit 5256e00f3e
2 changed files with 3 additions and 5 deletions

View File

@@ -67,9 +67,7 @@ impl ReceiptsLogPruneConfig {
let mut errors = Vec::new();
self.retain(|address, mode| {
if mode.is_distance() {
errors.push(PruneSegmentError::UnsupportedReceiptsLogFilterPruneMode(
*address, *mode,
));
errors.push(PruneSegmentError::UnsupportedReceiptsLogFilterDistance(*address));
return false;
}

View File

@@ -117,8 +117,8 @@ pub enum PruneSegmentError {
#[error("the configuration provided for {0} is invalid")]
Configuration(PruneSegment),
/// Unsupported receipts log filter prune mode for address.
#[error("unsupported receipts log filter prune mode for address {0}: {1:?}")]
UnsupportedReceiptsLogFilterPruneMode(Address, PruneMode),
#[error("distance prune mode is not supported for receipts log filter, check address {0}")]
UnsupportedReceiptsLogFilterDistance(Address),
}
#[cfg(test)]