MCPcopy
hub / github.com/silenceper/wechat / DecodeWithCommonError

Function DecodeWithCommonError

util/error.go:30–41  ·  view source on GitHub ↗

DecodeWithCommonError 将返回值按照 CommonError 解析

(response []byte, apiName string)

Source from the content-addressed store, hash-verified

28
29// DecodeWithCommonError 将返回值按照 CommonError 解析
30func DecodeWithCommonError(response []byte, apiName string) (err error) {
31 var commError CommonError
32 err = json.Unmarshal(response, &commError)
33 if err != nil {
34 return
35 }
36 commError.apiName = apiName
37 if commError.ErrCode != 0 {
38 return &commError
39 }
40 return nil
41}
42
43// DecodeWithError 将返回值按照解析
44func DecodeWithError(response []byte, obj interface{}, apiName string) error {

Callers 15

DelKnowledgeGroupMethod · 0.92
ModKnowledgeGroupMethod · 0.92
DelKnowledgeIntentMethod · 0.92
ModKnowledgeIntentMethod · 0.92
SetScheduleListMethod · 0.92
PunchCorrectionMethod · 0.92
AddUserFaceMethod · 0.92
AddOptionMethod · 0.92
UpdateOptionMethod · 0.92
ClearOptionMethod · 0.92
DelOptionMethod · 0.92
AddRecordMethod · 0.92

Calls

no outgoing calls

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…