Documentation ¶
Overview ¶
Package allerror provides a set of error codes and error types used in the application.
Index ¶
Constants ¶
View Source
const ( // ErrorCodeComputilityAccountFindError find computility account error ErrorCodeComputilityAccountFindError = "computility_account_find_error" // ErrorCodeComputilityOrgFindError find computility org error ErrorCodeComputilityOrgFindError = "computility_org_find_error" // ErrorCodeComputilityOrgUpdateError update computility org error ErrorCodeComputilityOrgUpdateError = "computility_org_update_error" // ErrorComputilityOrgQuotaLowerBoundError quota count lower bound error ErrorComputilityOrgQuotaLowerBoundError = "computility_org_quota_lower_bound_error" // ErrorComputilityOrgQuotaMultipleError quota count not a multiple of default quota ErrorComputilityOrgQuotaMultipleError = "computility_org_quota_multiple_error" // ErrorCodeInsufficientQuota user has insufficient quota balance ErrorCodeInsufficientQuota = "insufficient_quota" // ErrorCodeNoNpuPermission user has no npu permission ErrorCodeNoNpuPermission = "no_npu_permission" // ErrorCodeAccessTokenInvalid This error code is for restful api ErrorCodeAccessTokenInvalid = "access_token_invalid" // ErrorCodeSpaceAppUnmatchedStatus is const ErrorCodeSpaceAppUnmatchedStatus = "space_app_unmatched_status" // ErrorCodeSpaceAppNotFound space app ErrorCodeSpaceAppNotFound = "space_app_not_found" // ErrorCodeSpaceNotFound is const ErrorCodeSpaceNotFound = "space_not_found" // ErrorCodeSpaceCommitConflict is const ErrorCodeSpaceCommitConflict = "space_commit_conflict" // ErrorCodeSpaceAppCreateFailed ErrorCodeSpaceAppCreateFailed = "space_app_create_failed" // ErrorCodeUserNotFound ErrorCodeUserNotFound = "user_not_found" // ErrorCodeRevokePrivacyFailed ErrorCodeRevokePrivacyFailed = "revoke_privacy_failed" // ErrorCodeRevokeAgreementFailed ErrorCodeRevokeAgreementFailed = "revoke_agreement_failed" )
Variables ¶
This section is empty.
Functions ¶
func IsNotFound ¶
IsNotFound checks if the given error is a not found error.
func New ¶
New creates a new error with the specified code and message.
This function creates a new errorImpl struct with the specified code, message and error info for diagnostic. If the message is empty, the function will replace all "_" in the code with " " as the message.
Parameters:
code: a string representing the type of the error msg: a string representing the error message, which is returned to client or end user err: error info for diagnostic, which is used for diagnostic by developers
Returns an errorImpl struct.
func NewNotFound ¶
NewNotFound creates a new not found error with the specified code and message.
Types ¶
type InnerError ¶
type InnerError interface {
InnerError() error
}
InnerError returns the inner error.
Click to show internal directories.
Click to hide internal directories.