fix: error formatting

This commit is contained in:
yusing
2025-05-13 20:11:03 +08:00
parent 44b4cff35e
commit 21724c037f
4 changed files with 31 additions and 12 deletions

View File

@@ -59,6 +59,9 @@ func (b *Builder) Error() Error {
if len(b.errs) == 0 {
return nil
}
if len(b.errs) == 1 && b.about == "" {
return wrap(b.errs[0])
}
return &nestedError{Err: New(b.about), Extras: b.errs}
}