Skip to content

Commit

Permalink
bug:插件执行失败时的错误码类型归属错误问题优化 TencentBlueKing#11294
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Dec 20, 2024
1 parent 375fa6a commit 8fae643
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ enum class ErrorType(
SYSTEM("system", 0), // 0 系统运行报错
USER("user", 1), // 1 用户配置报错
THIRD_PARTY("thirdParty", 2), // 2 第三方系统接入错误
PLUGIN("plugin", 3); // 3 插件执行错误
PLUGIN("plugin", 3), // 3 插件执行错误
BUILD_MACHINE("buildMachine", 4); // 4 构建机运行报错

companion object {

Expand All @@ -57,6 +58,7 @@ enum class ErrorType(
0 -> SYSTEM
1 -> USER
2 -> THIRD_PARTY
4 -> BUILD_MACHINE
else -> PLUGIN
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class HeartbeatControl @Autowired constructor(
actionType = ActionType.TERMINATE,
executeCount = container.executeCount,
reason = tipMessage,
errorTypeName = ErrorType.THIRD_PARTY.name,
errorTypeName = ErrorType.BUILD_MACHINE.name,
errorCode = ErrorCode.THIRD_PARTY_BUILD_ENV_ERROR
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ class RemoteServiceExceptionD : ExceptionDecorator<RemoteServiceException> {
override fun decorate(exception: RemoteServiceException): TaskExecuteException {
return TaskExecuteException(
errorMsg = "THIRD PARTY response error: ${exception.message}",
errorType = ErrorType.THIRD_PARTY,
errorCode = ErrorCode.THIRD_PARTY_INTERFACE_ERROR,
errorType = ErrorType.SYSTEM,
errorCode = ErrorCode.SYSTEM_SERVICE_ERROR,
cause = exception
)
}
Expand Down

0 comments on commit 8fae643

Please sign in to comment.