File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ import "fmt"
66type APIException interface {
77 error
88 ErrorCode () int
9- WithMeta (m interface {})
9+ WithMeta (m interface {}) APIException
1010 Meta () interface {}
11- WithData (d interface {})
11+ WithData (d interface {}) APIException
1212 Data () interface {}
1313 Is (code int ) bool
1414 Namespace () string
@@ -44,16 +44,18 @@ func (e *exception) ErrorCode() int {
4444}
4545
4646// WithMeta 携带一些额外信息
47- func (e * exception ) WithMeta (m interface {}) {
47+ func (e * exception ) WithMeta (m interface {}) APIException {
4848 e .meta = m
49+ return e
4950}
5051
5152func (e * exception ) Meta () interface {} {
5253 return e .meta
5354}
5455
55- func (e * exception ) WithData (d interface {}) {
56+ func (e * exception ) WithData (d interface {}) APIException {
5657 e .data = d
58+ return e
5759}
5860
5961func (e * exception ) Data () interface {} {
You can’t perform that action at this time.
0 commit comments