- show station info when jd api failed
This commit is contained in:
@@ -196,6 +196,22 @@ func (a *API) AccessAPI(apiStr string, jdParams map[string]interface{}) (retVal
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
if codeErr, ok := err.(*utils.ErrorWithCode); ok {
|
||||
appendErrList := []string{}
|
||||
for _, key := range []string{
|
||||
KeyOutStationNo,
|
||||
KeyStationNo,
|
||||
} {
|
||||
if jdParams[key] != nil {
|
||||
appendErrList = append(appendErrList, fmt.Sprintf("[%s:%v]", key, jdParams[key]))
|
||||
}
|
||||
}
|
||||
if len(appendErrList) > 0 {
|
||||
err = utils.NewErrorCode(strings.Join(appendErrList, ",")+", "+codeErr.ErrMsg(), codeErr.Code())
|
||||
}
|
||||
}
|
||||
}
|
||||
return retVal, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user