diff --git a/Cargo.lock b/Cargo.lock index f5c799b..15f60e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,7 +278,7 @@ dependencies = [ [[package]] name = "notmad" -version = "0.7.2" +version = "0.7.3" dependencies = [ "anyhow", "async-trait", diff --git a/crates/mad/src/lib.rs b/crates/mad/src/lib.rs index 85e46ff..18ea9d9 100644 --- a/crates/mad/src/lib.rs +++ b/crates/mad/src/lib.rs @@ -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 {