This commit is contained in:
withchao
2023-03-07 17:21:48 +08:00
parent 37d04c9fa0
commit d80cf34f26
12 changed files with 21 additions and 108 deletions
+2 -3
View File
@@ -9,7 +9,6 @@ package http
import (
"OpenIM/pkg/callbackstruct"
"OpenIM/pkg/common/config"
"OpenIM/pkg/common/constant"
"OpenIM/pkg/errs"
"bytes"
"encoding/json"
@@ -79,13 +78,13 @@ func callBackPostReturn(url, command string, input interface{}, output callbacks
if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue {
return errs.ErrCallbackContinue
}
return constant.NewErrNetwork(err)
return errs.ErrNetwork.Wrap(err.Error())
}
if err = json.Unmarshal(b, output); err != nil {
if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue {
return errs.ErrCallbackContinue
}
return constant.NewErrData(err)
return errs.ErrData.Wrap(err.Error())
}
return output.Parse()
}