fixed error subject missing in some cases

This commit is contained in:
yusing
2024-10-01 05:14:56 +08:00
parent e951194bee
commit f5a36f94bb
2 changed files with 8 additions and 3 deletions

View File

@@ -182,8 +182,7 @@ func (ne NestedError) Subjectf(format string, args ...any) NestedError {
if strings.Contains(format, "%w") {
panic("Subjectf format should not contain %w")
}
ne.subject = fmt.Sprintf(format, args...)
return ne
return ne.Subject(fmt.Sprintf(format, args...))
}
func (ne NestedError) JSONObject() jsonNestedError {