B:BD[
2.237] → [
2.237:625]
let mut chain = self.chain().skip(1).enumerate().peekable();
if let Some((n, error)) = chain.next() {
write!(f, "\nCaused by:\n ")?;
if chain.peek().is_some() {
write!(f, "{}: ", n)?;
}
writeln!(f, "{}", error)?;
for (n, error) in chain {
writeln!(f, " {}: {}", n, error)?;
if let Some(cause) = error.source() {
write!(f, "\nCaused by:\n")?;
let multiple = cause.source().is_some();
for (n, error) in Chain::new(cause).enumerate() {
write!(f, " ")?;
if multiple {
write!(f, "{}: ", n)?;
}
writeln!(f, "{}", error)?;