Skip to content

Commit

Permalink
feat:完善文件上传相关错误信息
Browse files Browse the repository at this point in the history
  • Loading branch information
NICEXAI committed Aug 26, 2021
1 parent 362d985 commit e4ee432
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ const (
SDKUnknownError Error = "未知错误"
// SDKInvalidCredential 错误码:40001
SDKInvalidCredential Error = "不合法的secret参数"
// SDKInvalidImageSize 错误码:40009
SDKInvalidImageSize Error = "无效的图片大小"
// SDKInvalidCorpID 错误码:40013
SDKInvalidCorpID Error = "无效的 CorpID"
// SDKAccessTokenInvalid 错误码:40014
SDKAccessTokenInvalid Error = "AccessToken 无效"
// SDKMediaIDExceedMinLength 错误码:40058
SDKMediaIDExceedMinLength Error = "media_id 小于最小长度 1"
// SDKAccessTokenMissing 错误码:41001
SDKAccessTokenMissing Error = "缺少AccessToken参数"
// SDKAccessTokenExpired 错误码:42001
Expand Down Expand Up @@ -51,6 +55,8 @@ func NewSDKErr(code int, msgList ...string) Error {
return SDKCacheUnavailable
case 40001:
return SDKInvalidCredential
case 40009:
return SDKInvalidImageSize
case 41001:
return SDKAccessTokenMissing
case 42001:
Expand All @@ -59,6 +65,8 @@ func NewSDKErr(code int, msgList ...string) Error {
return SDKInvalidCorpID
case 40014:
return SDKAccessTokenInvalid
case 40058:
return SDKMediaIDExceedMinLength
case 45009:
return SDKApiFreqOutOfLimit
case 48002:
Expand Down

0 comments on commit e4ee432

Please sign in to comment.