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

@@ -11,9 +11,11 @@ type nestedError struct {
Extras []error `json:"extras"`
}
var emptyError = errStr("")
func (err nestedError) Subject(subject string) Error {
if err.Err == nil {
err.Err = PrependSubject(subject, errStr(""))
err.Err = PrependSubject(subject, emptyError)
} else {
err.Err = PrependSubject(subject, err.Err)
}