Skip to content

Commit

Permalink
Merge pull request #105 from yjieliang/issue_8211
Browse files Browse the repository at this point in the history
pref:蓝盾国际化方案优化 #8211
  • Loading branch information
yjieliang committed May 24, 2023
2 parents 142e6cb + e1ac22f commit fa4b5ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package com.tencent.devops.plugin.codecc.service
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import com.tencent.devops.common.api.constant.CommonMessageCode.BK_VIEW_DETAILS
import com.tencent.devops.common.api.exception.ErrorCodeException
import com.tencent.devops.common.api.exception.RemoteServiceException
import com.tencent.devops.common.api.util.OkhttpUtils
import com.tencent.devops.common.client.Client
import com.tencent.devops.common.pipeline.enums.ChannelCode
Expand Down Expand Up @@ -198,9 +198,9 @@ class CodeccService @Autowired constructor(
val body = response.body!!.string()
logger.info("codecc blueShield response: $body")
if (!response.isSuccessful) {
throw ErrorCodeException(
errorCode = response.code.toString(),
defaultMessage = "get codecc blueShield response fail $body"
throw RemoteServiceException(
errorCode = response.code,
errorMessage = "get codecc blueShield response fail $body"
)
}
return objectMapper.readValue(body, BlueShieldResponse::class.java)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ open class CodeccApi constructor(
val body = response.body!!.string()
logger.info("codecc opensource measurement response: $body")
if (!response.isSuccessful) {
throw ErrorCodeException(
errorCode = response.code.toString(),
defaultMessage = "get codecc opensource measurement response fail.$body"
throw RemoteServiceException(
errorCode = response.code,
errorMessage = "get codecc opensource measurement response fail.$body"
)
}
return objectMapper.readValue(body)
Expand Down

0 comments on commit fa4b5ed

Please sign in to comment.