|
|
|
@@ -511,23 +511,27 @@ sendjob: |
|
|
|
log.Error("json.Unmarshal failed(%s): %v", res.String(), err.Error()) |
|
|
|
return &result, fmt.Errorf("json.Unmarshal failed(%s): %v", res.String(), err.Error()) |
|
|
|
} |
|
|
|
log.Error("createTrainJob failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
BootFileErrorMsg := "Invalid OBS path '" + createJobParams.Config.BootFileUrl + "'." |
|
|
|
DataSetErrorMsg := "Invalid OBS path '" + createJobParams.Config.DataUrl + "'." |
|
|
|
if temp.ErrorMsg == BootFileErrorMsg { |
|
|
|
log.Error("启动文件错误!createTrainJob failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
log.Error("createTrainJobUserImage failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
bootFileErrorMsg := "Invalid OBS path '" + createJobParams.Config.BootFileUrl + "'." |
|
|
|
dataSetErrorMsg := "Invalid OBS path '" + createJobParams.Config.DataUrl + "'." |
|
|
|
if temp.ErrorMsg == bootFileErrorMsg { |
|
|
|
log.Error("启动文件错误!createTrainJobUserImage failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
return &result, fmt.Errorf("启动文件错误!") |
|
|
|
} |
|
|
|
if temp.ErrorMsg == DataSetErrorMsg { |
|
|
|
log.Error("数据集错误!createTrainJob failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
if temp.ErrorMsg == dataSetErrorMsg { |
|
|
|
log.Error("数据集错误!createTrainJobUserImage failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
return &result, fmt.Errorf("数据集错误!") |
|
|
|
} |
|
|
|
return &result, fmt.Errorf("createTrainJob failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
if res.StatusCode() == http.StatusBadGateway { |
|
|
|
return &result, fmt.Errorf(UnknownErrorPrefix+"createTrainJobUserImage failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
} else { |
|
|
|
return &result, fmt.Errorf("createTrainJobUserImage failed(%d):%s(%s)", res.StatusCode(), temp.ErrorCode, temp.ErrorMsg) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if !result.IsSuccess { |
|
|
|
log.Error("createTrainJob failed(%s): %s", result.ErrorCode, result.ErrorMsg) |
|
|
|
return &result, fmt.Errorf("createTrainJob failed(%s): %s", result.ErrorCode, result.ErrorMsg) |
|
|
|
log.Error("createTrainJobUserImage failed(%s): %s", result.ErrorCode, result.ErrorMsg) |
|
|
|
return &result, fmt.Errorf("createTrainJobUserImage failed(%s): %s", result.ErrorCode, result.ErrorMsg) |
|
|
|
} |
|
|
|
|
|
|
|
return &result, nil |
|
|
|
|