This commit is contained in:
Mrx
2026-03-25 15:03:45 +08:00
parent 9438ccee5e
commit 5f0224ad3b
2 changed files with 29 additions and 6 deletions

View File

@@ -4,6 +4,17 @@ import (
"fmt"
)
// GetQueryEmptyErrByCode 将数据宝错误码归类为“查询为空/不扣费”错误。
// 说明:上游通常依赖 errors.Is(err, ErrQueryEmpty) 来决定是否扣费。
func GetQueryEmptyErrByCode(code string) error {
switch code {
case "10001", "10006":
return ErrQueryEmpty
default:
return nil
}
}
// ShujubaoError 数据宝服务错误
type ShujubaoError struct {
Code string `json:"code"`