tt/core/error.go

23 lines
395 B
Go
Raw Normal View History

2024-05-28 08:47:31 +08:00
package core
import "fmt"
type WxError struct {
ErrorCode int // 错误码
Message string // 错误信息
}
func (e WxError) Error() string {
return fmt.Sprintf("Error Code: %d, Message: %s", e.ErrorCode, e.Message)
}
// Code Error 错误码
func (e WxError) Code() int {
return e.ErrorCode
}
// ErrorMsg Error 错误信息
func (e WxError) ErrorMsg() int {
return e.ErrorMsg()
}