If `prevErr.isZero()` is `true`, it will skip writing current error string.
Author: mritunjaykumarCreated Feb 23, 2021Updated Feb 13, 2024
I believe there is a bug at this line https://github.com/upspin/upspin/blob/master/errors/errors.go#L265 rather than
if e.Err != nil {
// Indent on new line if we are cascading non-empty Upspin errors.
if prevErr, ok := e.Err.(*Error); ok {
if !prevErr.isZero() {
pad(b, Separator)
b.WriteString(e.Err.Error())
}
} else {
pad(b, ": ")
b.WriteString(e.Err.Error())
}
}it should be
if e.Err != nil {
// Indent on new line if we are cascading non-empty Upspin errors.
if prevErr, ok := e.Err.(*Error); ok {
if !prevErr.isZero() {
pad(b, Separator)
} else {
pad(b, ": ")
}
} else {
pad(b, ": ")
}
b.WriteString(e.Err.Error())
}Source: upspin/upspin