forked from TencentBlueKing/bk-turbo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: turbo后台信息国际化-异常错误信息国际化 TencentBlueKing#86
- Loading branch information
Showing
11 changed files
with
53 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...api/src/main/kotlin/com/tencent/devops/common/api/exception/UnauthorizedErrorException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.tencent.devops.common.api.exception | ||
|
||
import com.tencent.devops.common.api.exception.code.IS_NOT_ADMIN_MEMBER | ||
|
||
class UnauthorizedErrorException( | ||
val errorCode: String = IS_NOT_ADMIN_MEMBER, | ||
errorMessage: String = "" | ||
) : RuntimeException(errorMessage) |
6 changes: 5 additions & 1 deletion
6
...urbo-api/src/main/kotlin/com/tencent/devops/common/api/exception/code/TurboMessageCode.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
package com.tencent.devops.common.api.exception.code | ||
|
||
/** | ||
* 如果需要自定义错误码,必须同步添加到i18n资源文件 | ||
* 若想不到异常分类,且需要自定义error message,请使用通用异常(不建议) | ||
*/ | ||
const val TURBO_GENERAL_SYSTEM_FAIL = "2121001" // 通用异常 | ||
const val TURBO_THIRDPARTY_SYSTEM_FAIL = "2121002" // 调用第三方系统失败 | ||
const val TURBO_NO_DATA_FOUND = "2121003" // 没有查询到对应数据 | ||
const val TURBO_PARAM_INVALID = "2121004" // 参数异常 | ||
const val IS_NOT_ADMIN_MEMBER = "2300017" // 非管理员,操作失败 | ||
const val IS_NOT_ADMIN_MEMBER = "2121005" // 非管理员,操作失败 | ||
const val SUB_CLASS_CHECK_ERROR = "2121006" // 子类检查错误 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters