@@ -46,6 +46,13 @@ func WithCode[T codeType](err error, businessCode T, options ...Option) error {
option(ret)
}
+ if err == nil {
+ return &withStack{
+ error: ret,
+ stack: callers(),
+ }
+
return ret