- place detail error msg in ErrorWithCode when access jd api.

This commit is contained in:
gazebo
2018-07-22 13:49:49 +08:00
parent b4090f2c41
commit 0bab97ed2a
5 changed files with 4 additions and 12 deletions

View File

@@ -105,10 +105,10 @@ func MergeMaps(firstMap map[string]interface{}, otherMaps ...map[string]interfac
return retVal
}
func CallFuncLogError(funcToCall func() error, msg string) error {
func CallFuncLogError(funcToCall func() error, msg string, params ...interface{}) error {
err := funcToCall()
if err != nil {
baseapi.SugarLogger.Warnf("%s, error:%v", msg, err.Error())
baseapi.SugarLogger.Warnf("Failed "+msg+" error:%v", append(params, err.Error())...)
}
return err
}