This commit is contained in:
zchh 2021-01-08 23:39:46 +08:00
parent 958f77ab90
commit 424817e9a1

View File

@ -3,6 +3,7 @@ package error
import (
"fmt"
"github.com/beego/beego/v2/core/codes"
"strconv"
)
type Error struct {
@ -26,7 +27,8 @@ func Errorf(c codes.Code, format string, a ...interface{}) error {
}
func (e *Error) Error() string {
return fmt.Sprintf("beego error: code = %s desc = %s", e.GetCode(), e.GetMessage())
codeSrt := strconv.FormatUint(uint64(e.GetCode()), 10)
return fmt.Sprintf("beego error: code = %s desc = %s", codeSrt, e.GetMessage())
}
func (x *Error) GetCode() codes.Code {