fix(xerror): [xerror] drop leading ": " when message is empty (#423)

* fix(xerror): [xerror] drop leading ": " when message is empty

* test(xerror): [xerror] cover Wrap without a message
This commit is contained in:
Lee Sang Gyu authored and GitHub committed 2026-11-09 12:27:37 +08:00
1 parent afc0d3c676
commit 0eabb67ed4
2 files changed
+16

No files matched your search

+4
View File
@@ -87,6 +87,10 @@ func (e *XError) Error() string {
return msg
}
if msg == "" {
return cause.Error()
}
msg = fmt.Sprintf("%s: %v", msg, cause.Error())
return msg