feat: cleanup aggregate error for single error
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-07-24 22:18:45 +02:00
parent a16bee8e37
commit 5da3c83c12
2 changed files with 9 additions and 1 deletions

2
Cargo.lock generated
View File

@@ -278,7 +278,7 @@ dependencies = [
[[package]]
name = "notmad"
version = "0.7.2"
version = "0.7.3"
dependencies = [
"anyhow",
"async-trait",

View File

@@ -49,6 +49,14 @@ impl AggregateError {
impl Display for AggregateError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if self.errors.is_empty() {
return Ok(());
}
if self.errors.len() == 1 {
return f.write_str(&self.errors.first().unwrap().to_string());
}
f.write_str("MadError::AggregateError: (")?;
for error in &self.errors {