Skip to content

Commit

Permalink
fix: handle the returned error
Browse files Browse the repository at this point in the history
Signed-off-by: yang <[email protected]>
  • Loading branch information
big-dust committed Oct 17, 2023
1 parent bbb4a41 commit 345c4d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
17 changes: 9 additions & 8 deletions biz/model/dto/httpbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ const (
AgentCodeCallDiskUsageFailedStr = "AG-563"
AgentCodeMissingMainStorageFailedStr = "AG-590"

AgentCodeSwitchDomainErr = "AG-570" //域名错误
AgentCodeSwitchToNewSSPErr = "AG-571" //临时指向到新的空间平台错误
AgentCodeSwitchNetworkTestErr = "AG-572" //网络测试失败
AgentCodeSwitchRecallGatewayErr = "AG-573" //回写网关失败
AgentCodeSwitchDoingErr = "AG-574" //切换任务正在执行
AgentCodeSwitchGetAccountErr = "AG-575" //从网关获取账号失败
AgentCodeSwitchImigrateErr = "AG-576" //新空间平台迁入失败
AgentCodePrivateSSPRegBoxErr = "AG-577" //私有空间平台注册盒子错误
AgentCodeSwitchDomainErr = "AG-570" //域名错误
AgentCodeSwitchToNewSSPErr = "AG-571" //临时指向到新的空间平台错误
AgentCodeSwitchNetworkTestErr = "AG-572" //网络测试失败
AgentCodeSwitchRecallGatewayErr = "AG-573" //回写网关失败
AgentCodeSwitchDoingErr = "AG-574" //切换任务正在执行
AgentCodeSwitchGetAccountErr = "AG-575" //从网关获取账号失败
AgentCodeSwitchImigrateErr = "AG-576" //新空间平台迁入失败
AgentCodePrivateSSPRegBoxErr = "AG-577" //私有空间平台注册盒子错误
AgentCodeCopyDataToStatusInfoErr = "AG-578" //将迁入请求数据转移到状态信息失败

AgentCodeSwitchTaskNotFoundErr = "AG-580" //切换任务未找到
AgentCodeConnectErr = "AG-581" //连接错误
Expand Down
10 changes: 9 additions & 1 deletion biz/service/switch-platform/switch_platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,15 @@ func doSwitch(transId string, domain string) (dto.BaseRspStr, error) {
UpdateStatus(StatusAbort, basersp.Message)
return basersp, err
}
copier.Copy(&si.ImigrateResult, imigrateRsp)

err = copier.Copy(&si.ImigrateResult, imigrateRsp)
if err != nil {
var basersp dto.BaseRspStr
basersp.Code = dto.AgentCodeCopyDataToStatusInfoErr
basersp.Message = "failed to transport data to StatusInfo."
UpdateStatus(StatusAbort, basersp.Message)
return basersp, err
}

logger.AppLogger().Debugf("transId=%v, imigrateRsp:%+v, ",
transId, imigrateRsp)
Expand Down

0 comments on commit 345c4d5

Please sign in to comment.