|
|
@@ -13,6 +13,7 @@ const (
|
|
|
ErrNotExistCode uint32 = 0x00000004
|
|
|
ErrTypeTransferCode uint32 = 0x00000005
|
|
|
ErrAuthCode uint32 = 0x00000006
|
|
|
+ ErrDataCode uint32 = 0x00000007
|
|
|
ErrCustomCode uint32 = 0x00001000
|
|
|
)
|
|
|
|
|
|
@@ -23,6 +24,7 @@ var codeMap = map[uint32]string{
|
|
|
ErrNotExistCode: "资源不存在",
|
|
|
ErrTypeTransferCode: "类型转换错误",
|
|
|
ErrAuthCode: "鉴权错误",
|
|
|
+ ErrDataCode: "数据异常",
|
|
|
ErrCustomCode: "自定义错误",
|
|
|
}
|
|
|
|
|
|
@@ -68,6 +70,10 @@ func NewAuthError(message string) *Error {
|
|
|
return newError(ErrAuthCode, message)
|
|
|
}
|
|
|
|
|
|
+func NewDataError(message string) *Error {
|
|
|
+ return newError(ErrDataCode, message)
|
|
|
+}
|
|
|
+
|
|
|
func NewCustomError(message string) *Error {
|
|
|
return newError(ErrCustomCode, message)
|
|
|
}
|